• Resolved ctrlaltdelete

    (@ctrlaltdelete)


    Hello, could you produce the Query args necessary to retrieve posts that have the noindex option enabled?

    The option is for individual posts under advanced it says “Allow search engines to show this post in search results?”

    I need to list all the posts that have it set to “No”.

    Thanks!

    SOLUTION:

    $args = array(
    	'post_type' => array('post', 'another'),
       'meta_key' => '_yoast_wpseo_meta-robots-noindex',
       'meta_query' => array(
           array(
               'key' => '_yoast_wpseo_meta-robots-noindex',
               'value' => '1',
               'compare' => '=',
           )
       )
    );
    • This topic was modified 2 years, 3 months ago by ctrlaltdelete.
  • The topic ‘Query posts that have noindex’ is closed to new replies.