No Index pages generated by ad network

#672374
  • Resolved Julie Julien
    Rank Math free

    Hi,

    I’d like to noindex pages generated by my ad network (not block them in the robot.txt)

    These are the base of the urls: (always followed by a bunch of different things)

    giftideahub.com/detroitchicago/
    giftideahub.com/porpoiseant/
    giftideahub.com/beardeddragon/
    giftideahub.com/tardisrocinante/

    What do I need to add and where in order to do that?

    Thank you for your help,
    Julie

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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:

    1. Go to your WordPress admin area and navigate to Rank Math SEO → Titles & Meta → Global Meta.

    2. 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:

    No Index Robots Meta

    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.

    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.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘No Index pages generated by ad network’ is closed to new replies.