How to noindex “add to cart” pages?

#1057185
Viewing 15 replies - 1 through 15 (of 22 total)
  • Hello,

    I apologize for the issue you are facing. To set the "Add to Cart" pages to noindex using Rank Math, you can follow these steps:

    1. Navigate to Rank Math SEO Settings: Go to your WordPress dashboard and click on Rank Math in the left sidebar.
    2. Titles & Meta: Click on Titles & Meta under the Rank Math menu.
    3. Product Pages: Look for the section related to Products. Here, you can manage the indexing settings for your product pages.
    4. Noindex Option: You may need to enable the No Index option for the specific product pages or categories that include the "Add to Cart" functionality. This will prevent search engines from indexing those pages.
    5. Save Changes: Don’t forget to save your changes after making adjustments.

    If you want to set noindex for individual product pages, you can do this by editing each product and navigating to the Advanced tab in the Rank Math meta box, where you can set it to noindex.

    For more detailed guidance, you can refer to our tutorial on How to Noindex URLs With Rank Math.

    If you need further assistance or if there are specific settings you would like us to check, please reply to this ticket, and a human agent from our support team will assist you further.

    Thank you for raising this concern!

    Sources:
    How to Noindex URLs With Rank Math » Rank Math

    I need more help from a real agent.

    Hello,

    Thank you for contacting Rank Math support and we apologize for the inconvenience.

    By default, Rank Math automatically adds noindex to the cart pages to stop Google search engine from indexing your cart. There’s no need for Google to index these pages as the page is unique to each user of your site.

    You can set the cart page to no index by adding the following rules to your robots.txt file in WordPress Dashboard > Rank Math > General Settings > Edit Robots.txt to prevent Google from crawling such URLs:

    
    Disallow: /*?add-to-cart=
    

    You can follow this guide to Edit Your Robots.txt With Rank Math SEO: https://rankmath.com/kb/how-to-edit-robots-txt-with-rank-math/

    Hope that helps.

    Thank you.

    Rene Bezuijen
    Rank Math free

    Is there way to check if google still indexes this afterwards? And how do I let google know all of this is fixed so that I will see the positive results in Search Console?

    Hello,

    Please share the add-to-cart pages so we can check as well.

    Meanwhile, disallowing them in your robots.txt will only prevent those URLs from getting crawled.

    If somehow your add-to-cart links are set to index, you can add this filter on your site to force their robots meta tag to noindex:

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

    Here’s a guide you can follow to apply that:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Also, you should not include the disallow rule in your robots.txt for those filter paths so Google can read the noindex meta tag.

    After that, you should give Google some time to recrawl your site and those add-to-cart pages won’t be included in your index reports.

    Looking forward to helping you.

    Rene Bezuijen
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Rene Bezuijen
    Rank Math free

    And this is how my virtual robot.txt file looks like in rank math settings.|

    User-agent: *
    Disallow: /*?add-to-cart=
    Disallow: /wp-login.php
    Disallow: /wp-admin/
    Disallow: /voordeur/

    Hello,

    Your add to cart URLs are still set to index. Please follow the steps we have previously shared above to noindex them.

    Then, remove this disallow rule from your robots.txt:

    Disallow: /*?add-to-cart=

    Here are our default robots.txt rules we recommend:
    https://rankmath.com/kb/how-to-edit-robots-txt-with-rank-math/#default-rules

    Looking forward to helping you.

    Rene Bezuijen
    Rank Math free

    Coul you tell me again specifically which steps I have to take. Lost it.

    Regards, Chris

    Hello,

    You may need to add this code/filter on your site to force their robots meta tag to noindex:

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

    Here’s a guide you can follow to apply that:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Then, remove this line from your robots.txt:

    Disallow: /*?add-to-cart=

    Looking forward to helping you.

    Ok, I’ve succesfully placed the code in the functions.php file. Then I deleted Disallow: /*?add-to-cart= from the robots.txt file.

    Whats the next step?

    Hello,

    The cart pages are still set to index.

    We might need to take a closer look at your website to investigate this further. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Ok, I’ve added the credentials. Hope you can find the solution.

    Hello,

    The username or password you shared is not working, as we’re getting this error:
    Uw inloggegevens zijn niet correct

    Could you please check so we can investigate further?

    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 15 replies - 1 through 15 (of 22 total)

The ticket ‘How to noindex “add to cart” pages?’ is closed to new replies.