Hello,
I understand that you want to noindex pages generated by your ad network without blocking them in the robots.txt file. To achieve this, you can use the “No Index Robots Meta” feature in Rank Math.
You can add the No Index Robots Meta to the specific pages by following these steps:
-
Go to your WordPress admin area and navigate to Rank Math SEO → Titles & Meta → Global Meta.
-
In the Global Meta section, you can add the specific URLs you mentioned (e.g., giftideahub.com/detroitchicago/) and enable the “No Index” option for these pages.
Here’s a visual guide to help you with the process:
After adding the No Index Robots Meta to these pages, remember to clear the cache and wait for Google to crawl your website again.
If you have any further questions or need additional assistance, feel free to ask.
We’re here to help!
Sources:
Using Rank Math’s ‘Quick Actions’ Admin Menu Item
How to Fix the “Indexed, though blocked by robots.txt” Error » Rank Math
How to Fix the Submitted URL Seems to Be a “Soft 404” Error » Rank Math
Advanced Tab in Rank Math SEO’s Meta Box
Hello,
Thank you for your query, and we are so sorry about the trouble this must have caused.
Please use the following filter code that we have written specific for your needs :
add_filter( 'rank_math/frontend/robots', function( $robots ) {
// List of strings to check in the URL
$noindex_strings = array(
'/detroitchicago/',
'/porpoiseant/',
'/beardeddragon/',
'/tardisrocinante/',
);
// Get the current URL
$current_url = home_url( add_query_arg( null, null ) );
// Check if the current URL contains any of the specified strings
foreach ( $noindex_strings as $string ) {
if ( strpos( $current_url, $string ) !== false ) {
// Set the page to noindex and nofollow
$robots['index'] = 'noindex';
$robots['follow'] = 'nofollow';
break; // Break the loop as we've found a match
}
}
return $robots;
});
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
We hope that helps, and please don’t hesitate to get in touch if you have any other questions.
Thank you.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.