Quantcast
Channel: WordPress.org Forums » [Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Support
Viewing all articles
Browse latest Browse all 42467

Query posts that have noindex

$
0
0

Replies: 0

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 23 hours, 8 minutes ago by ctrlaltdelete.

Viewing all articles
Browse latest Browse all 42467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>