-
Hello guys,
I use the code below to add “noindex” to many garbage links that consume the crawl budget of search engines. But on the affected pages, there is in the page header the meta of rankmath showing “index”. It only a half page later that the “noindex” activated with the code below is shown.
Is it possible to add that noindex with your plugin ?
I’d like to do it with all the pages that contain these url parts :
?wmc-currency=
?v=
?ref=Here is the code I use in theme functions :
function add_noindex( $content ) {
global $post;$terms = wp_get_post_terms( $post->ID, ‘product_cat’ );
foreach ( $terms as $term ) $categories[] = $term->slug;if ( in_array( ‘bundles’, $categories ) || isset( $_GET[‘wmc_currency’]) ) {
echo ‘<meta name=”robots” content=”noindex, nofollow”>’ . $content;
}
}
add_filter(‘wp_head’, ‘add_noindex’);
The ticket ‘Rank math “index” conflict with wordpress native “noindex”’ is closed to new replies.