Alternate page with proper canonical tag for product variations

#941499
  • Resolved Roy
    Rank Math free

    I have Alternate page with proper canonical tag error in search console for variation links of the products. How to fix it

    Also shows Excluded by ‘noindex’ tag for redirect urls. How to fix it?

Viewing 1 replies (of 1 total)
  • Hello,

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

    In this case, you can set those URLs to noindex by adding this filter on your site:

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

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

    Once done, please clear your website’s cache and revalidate the issue in your Google Search Console account and give Google some time to recrawl your site.

    validate

    Looking forward to helping 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 ‘Alternate page with proper canonical tag for product variations’ is closed to new replies.