Add to cart, all link set to noindex

#347311
  • Resolved Milan Bojanić
    Rank Math pro

    Hi,

    First, how to set chekout page to no index, beacose i get 302 redirects.

    Second, when are costumer on product, for example: https://sam.2go.rs/auto-punjac-xiaomi-37w-bez-kabla-crni/ and if they go down on page, they get “add to cart” parts in down of site. That part is indexed and i get 302 error on SEO cheker on all products page.

    How to resolve that 302 redirection on all product page ?

    Crawl error image

    You have access in sensitive data

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    It is recommended to keep the pages like account, cart, and checkout set as noindex. However, if you want to set your checkout page as index then you can use the following filter in your theme’s functions.php file:

    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    	if ( is_checkout()  ) {
    			remove_action( 'wp_head', 'wc_page_noindex' );
    			return [
    				'index'  => 'index',
    				'follow' => 'follow',
    			];
    		}
    	
    	return $robots;
    });

    For the other errors, can you please share a screenshot of where you are getting 302 errors? You can use a tool like https://imgbb.com/ to share the screenshots.

    Looking forward to helping you.

    i cant uplaod image… here is again image:

    Screen-Shot-2022-02-19-at-15-40-18” rel=”noopener” target=”_blank”>First image

    Screen-Shot-2022-02-19-at-15-43-38” rel=”noopener” target=”_blank”>second image

    I solved problem. You can delte this post or close.

    Tnx

    Hello,

    Thank you for the update.

    We are glad that you have already managed to resolve this issue.

    If you have any other concerns, please don’t hesitate to contact us anytime to assist you further.

    Looking forward to helping you.

    Thank you.

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

The ticket ‘Add to cart, all link set to noindex’ is closed to new replies.