How to exclude SEO Framework noindex pagess
-
Hi,
I moved to the SEO Framework but I am struggling to make it work with SearchWP plugin.
Basically I’d like to exclude all the noindex pages that have a certain tag.
This below is the code I use for Yoast SEO. Could you please help me to adapt it to SEO Framework?
function my_searchwp_wordpress_seo_exclude_noindex( $ids, $engine, $terms ) { $entries_to_exclude = get_posts( array( 'post_type' => 'any', 'nopaging' => true, 'fields' => 'ids', 'meta_query' => array( array( 'key' => '_yoast_wpseo_meta-robots-noindex', 'value' => true, ), ), ) ); $ids = array_unique( array_merge( $ids, array_map( 'absint', $entries_to_exclude ) ) ); return $ids; } add_filter( 'searchwp_exclude', 'my_searchwp_wordpress_seo_exclude_noindex', 10, 3 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to exclude SEO Framework noindex pagess’ is closed to new replies.