Paginated pages no index not working

#472521
  • Resolved Development GrowME
    Rank Math pro

    Hello,

    We are trying out rankmath instead of yoast to solve an issue we have with google indexing our products pagination. We would like to no-index all our paginated pages
    ex.
    /shop/?product-page=4

    We enabled the setting but it’s still showing index, follow

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    Please ensure that both “Noindex Paginated Single Pages” and “Noindex Subpages” are enabled under Rank Math > Titles & Meta > Misc Pages.

    If the issue persists, please use this filter code instead:

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

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    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 ‘Paginated pages no index not working’ is closed to new replies.