?filter_by=featured, ?filter_by=review_high i want this pagess index off

#936596
Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting us and bringing your concern to our attention.

    Since the filter pages are generated dynamically, you can use the following filter to set them to Noindex and Nofollow:

    add_filter( 'rank_math/frontend/robots', function( $robots ) {
        $url = home_url( $_SERVER['REQUEST_URI'] );
        if( (strpos($url,'/?filter_by=') !== false) ) {
            $robots["index"] = 'noindex';
            $robots["follow"] = 'nofollow';
        }
        return $robots;
    });
    

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘?filter_by=featured, ?filter_by=review_high i want this pagess index off’ is closed to new replies.