Exclude Woocommerce “/shop/” page from sitemap that does not exist

#777236
  • Resolved Anonymous
    Rank Math free

    Hello,

    I have a client with a website that has Woocommerce but a plugin called catalogue mode to hide all kinds of functionality of Woocommerce. This includes the “/shop/” page, it does not exist and has not been there for years. I got tasked with optimizing his SEO and in the sitemap under products the first entry is the “/shop/” page, but as I can’t open it to find it’s ID, I can’t find a way to exclude it. The bot says I should use “/shop/” but I tried that, emptied cache and still it’s there. How to do this?

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

    I apologize for the inconvenience you are facing with excluding the “/shop/” page from the sitemap. Since the “/shop/” page does not exist due to the Catalogue Mode plugin hiding it, you can still exclude it from the sitemap by following these steps:

    1. Head to your WordPress Dashboard.
    2. Navigate to Rank Math SEO → Sitemap Settings → General.
    3. Scroll down to Exclude Posts and enter the ID of the “/shop/” page (even though it doesn’t exist) into the field. You can try using a placeholder ID like “9999” for example.
    4. Remember to separate multiple IDs with a comma.
    5. Scroll down and click Save Changes.

    By following these steps, you should be able to exclude the non-existing “/shop/” page from the sitemap. If you encounter any further issues or need additional assistance, please feel free to reply to this ticket, and a human agent from our support team will assist you promptly.

    Thank you for bringing this concern to our attention. We appreciate your efforts in optimizing your client’s SEO, and we are here to help you resolve this issue efficiently.

    Sources:
    How To Exclude Rank Math Sitemaps from Caching » Rank Math
    How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
    Remove Blank Lines From Sitemaps » Rank Math
    How to Exclude Content From Sitemap » Rank Math
    How to Configure Sitemaps in Rank Math – Best Settings and Tips

    Anonymous
    Rank Math free

    Hello,

    I feel like my explanation was completely disregarded. I can’t and ID from a page that does not exist. Please help.

    Hello,

    Apologies for the inconvenience.

    It seems that your shop page is the archive of your products, that’s why it is included in the first line of your product sitemap.

    However, to remove the URL from your /shop/ from your sitemap, you may need to use this filter on your site:

    add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){
    if ($post_type == 'product'){ // match to the actual post type name
    	$archive_url = false;
    }
    	return $archive_url;
    }, 10, 2 );

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

    Once done, follow these steps to flush your sitemap cache:
    https://i.rankmath.com/pipRDp

    Hope that helps.

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

The ticket ‘Exclude Woocommerce “/shop/” page from sitemap that does not exist’ is closed to new replies.