Removing Woocommerce Shop and specific category pages from sitemap

#492189
  • Resolved Adam Ford
    Rank Math free

    Hi, I’m managing a Woocommerce site for a client
    https://bloomingartflorist.com.au/
    I want to remove the /shop/ page and some of the category pages from the sitemap.
    /shop/ doesn’t appear as a separate page in WordPress so I can’t flick the noindex settings for it.

    Also, RankMath doesn’t even appear on any of the category pages? And these pages are pretty critical from an SEO perspective – right now I cannot edit the meta text or title specifically for these, deindex them or do anything. Is there some way of enabling RankMath on these pages?

    Thanks for any assistance.

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

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

    To set the shopping page to noindex and also remove it from the sitemap you can add both of these filters on your website:

    
    //Set as noindex
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
        if( is_shop() ) {
            $robots['index'] = 'noindex';
            $robots['follow'] = 'nofollow';
        }
        return $robots;
    });
    
    // Remove from sitemap
    add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){
        if($post_type == 'product') {
            return false;
        }
        return $archive_url;
    }, 10, 2 );
    

    ​​​​​​​As for the plugin not appearing in the taxonomy pages, please head over to WordPress Dashboard > Rank Math > Titles & Meta > Product Categories and make sure to enable the SEO Controls setting.

    Don’t hesitate to get in touch if you have any other questions.

    Thanks Miguel, but I’m not a developer, and my developer usually needs clearer instructions than “add both of these filters on your website”

    Can you explain WHERE this code needs to be added?

    Hello,

    You can add the filters on your website by following one of the methods mentioned here: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    This is the same for any filter that you are trying to add to WordPress and we are sure your developer being familiar with WordPress knows how to add these sorts of code snippets.

    Don’t hesitate to get in touch if you have any other questions.

    Ok, thanks, I’ll send that to my developer – but just back on the not seeing any Rank Math options for product categories.

    If you mean that I should enable “Add SEO Meta Box” for the product categories section, then it was already enabled. But I defintiely do not have the Rank Math meta box in the categories section of woocommerce. What would be preventing this and how can it be fixed?

    Hello,

    Normally, the SEO meta box should show up upon enabling the Add SEO Controls option in Rank Math > Titles & Meta > Product Categories.

    In this case, assuming you are using the latest version of all the plugins and the themes (please update if not yet), it would seem like a conflict with one of the plugins or the theme you are using.

    To determine that, please follow this troubleshooting guide:
    https://rankmath.com/kb/check-plugin-conflicts/

    Here is a video you can follow as well: https://www.youtube.com/watch?v=FcIWRhcUP2c

    Only the site admin would know and your users won’t be affected by this troubleshooting.

    Let us know how this goes.

    Thank you.

    OK thanks – I was actually lookuing at the POsts Categories section rather than Product Categories. Now fixed.

    But for some reason, enabling that facility has now created DUPLICATE product decsiption boxes for all categories – both populated with the same content. Is that expected behaviour?

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress login 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,

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

The ticket ‘Removing Woocommerce Shop and specific category pages from sitemap’ is closed to new replies.