?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.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.