Hello,
We apologize for the issue you are facing with your sitemap showing links to products that are no longer assigned to their respective categories. Thank you for providing detailed information about the steps you’ve already taken.
Here are a few suggestions to help resolve this issue:
-
Flush Permalinks: Sometimes, simply flushing the permalinks can help. Go to your WordPress dashboard, navigate to Settings → Permalinks, and click Save Changes without making any changes. This can refresh the sitemap generation process.
-
Check for Custom Canonicals: If you have set custom canonical URLs for these products, they may not appear in the sitemap. Ensure that there are no custom canonicals set for the affected products.
-
Recheck Category Assignments: Double-check that the products are indeed not assigned to the categories in both the WordPress admin and the database. Sometimes, there might be residual data that needs to be cleaned up.
-
Use Health Check Plugin: To rule out any plugin conflicts, consider using the Health Check plugin to see if any other plugins might be affecting the sitemap generation.
-
Regenerate Sitemap: After making these changes, regenerate your sitemap by going to Rank Math SEO → Sitemap Settings and toggling the sitemap settings off and then back on.
-
Clear Cache Again: After making these adjustments, clear your website cache again, including any server-side caching or CDN caching (like Cloudflare).
If these steps do not resolve the issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for your patience!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Hello,
Thank you for contacting us. We apologize for any inconvenience this issue may have caused.
Please follow the steps below for initial troubleshooting:
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/
Let us know how it goes. Looking forward to helping you.
Thank you.
It works! I have one more question. If I follow your instructions and add the sitemap-index.xml file in Cloudflare, will it still cache files like post-sitemap1.xml? Should I add something like sitemap* instead?
Thank you!
Hello,
Adding only the main sitemap /sitemap-index.xml
is sufficient. As we stated in the guide, typically Cloudflare shouldn’t cache the sitemap, so adding that page rule should exclude the main and sub-sitemaps from caching.
We hope this helps.
Thanks.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.