Hello,
Thank you for reaching out about the incorrect page found in your sitemap.xml file. It’s crucial to ensure that your sitemap.xml only includes good pages intended for your visitors to avoid confusing search engines and potential crawling issues.
To fix this error, you will need to review your sitemap.xml for any redirected, non-canonical, or non-200 URLs. Replace these URLs with final destination URLs that are canonical and return a 200 status code. This will help in providing accurate information to search engines and prevent any issues with crawling or sitemap rejection.
If you need further assistance or have any more questions, please feel free to reply to this ticket.
Thank you for your understanding and cooperation.
Best regards.
Sources:
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
Indexed, Not Submitted in Sitemap – Google Search Console » Rank Math
Rank Math Sitemap Issues and Their Fixes » Rank Math
How to Fix “Incorrect HTTP Header Content-Type” Error in Sitemaps » Rank Math
Hello,
Please share the affected URL which is appearing in your sitemap.xml so we can check.
Meanwhile, please follow these steps to flush your sitemap cache:
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. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:
/**
* Filter if XML sitemap transient cache is enabled.
*
* @param boolean $unsigned Enable cache or not, defaults to true
*/
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you’re not sure how to add this code, you can follow this guide:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how this goes.
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.