1

I am attempting to generate a list of all posts and their corresponding meta descriptions from the command line via ssh. I am able to connect to the host environment fine, but my command is only returning the last post and its meta description instead of all of them.

Note:

  1. I use Yoast to manage the meta data.
  2. I am able to make the SSH connection.

Here is my code:

wp post list --fields=ID,post_title,post_type,post_status,_yoast_wpseo_metadesc --meta_key=_yoast_wpseo_metadesc
Wes
  • 23
  • 3
  • 1
    Your code works for me. Can even use `--posts_per_page` with it to limit the amount of returned items. Do make sure though that all of your posts have their `_yoast_wpseo_metadesc` field populated with content, otherwise they'll be excluded from the output. – cabrerahector Jul 06 '22 at 20:25
  • Thank you @cabrerahector. You're correct. I literally just figured out, the issue was that I did not specify '--post_type=page'. None of the blog posts had meta descriptions in them and the pages were being ignored. For some reason I thought not specifying the post type would default to all post types. – Wes Jul 06 '22 at 20:49

0 Answers0