↑ ↓ select, Enter open, Esc close

Find posts with a specific meta key

Adjust the values, the command updates live
user@server
wp post list --post_type=any --meta_key=_yoast_wpseo_meta-robots-noindex --fields=ID,post_type,post_title --path=/var/www/vhosts/example.com/httpdocs

Finds all published content of every post type where the given meta field is set. The default value finds pages that were individually set to noindex in Yoast SEO. Add --meta_value=1 to also filter by value.

Note: Without --post_status, only published content is included. wp post meta get <ID> <key> shows the value of a field.

Also searched as

  • which pages use a custom field
  • find noindex pages wordpress
  • search post meta wp cli

Related one-liners

All in WP-CLI

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.