Hello,
We apologize for the inconvenience you’re experiencing with your XML Sitemap. It seems that the deleted products are still showing up in the sitemap, even after turning the feature off and on again.
To resolve this issue, you can try the following steps:
-
Flush Permalinks: If you’re getting a 404 error and Google can’t access your sitemap index, you may need to flush permalinks. To do this, go to the Permalinks page of your WordPress dashboard and click Save Changes. This should fix the issue.
-
Validate Your Sitemap: You can use the Validate XML Sitemap tool to confirm that your sitemap is correctly configured. Once done, click VALIDATE SITEMAP. If your sitemap is correctly configured, the tool will return a success message.
-
Ensure Your Posts Are Set to Index: If all your posts are set to noindex, your sitemap will become empty. To set your posts to index, head over to Rank Math SEO → Titles & Meta and enable the Index checkbox in the Robots Meta settings.
If these steps don’t resolve the issue, please let us know, and we’ll be happy to assist you further.
Thank you for bringing this to our attention.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
same for me, I deleted some pages, but they continue to appear in the sitemap.xml.
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
Could you please try to follow the steps below and see if that works for you?
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
https://rankmath.com/kb/exclude-sitemaps-from-caching/
3. If the above steps don’t seem to work, kindly apply the following filter to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank 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.