-
I have a problem with my website sitemaps generated by rankmath plugin….. The sitemaps included pages that gives 301 status and I want to remove them,
I try to update settings but sitemaps don’t update, and try to add some code to functions.php file but that doesn’t works.
Is there anything else I can do to fix it??
Thank you!!!@
-
Hello,
I’m sorry to hear about the issue you’re facing with your website sitemaps generated by the Rank Math plugin, including pages that give a 301 status. To address this problem, you can follow these steps:
-
Check Robots Meta Tag Settings: Ensure that the pages set to noindex in the robots meta tag will be excluded from the sitemap generated by Rank Math and can result in a 404 error. You can navigate to Rank Math SEO → Advanced tab in the post editing screen to check and update the settings.
-
Exclude Sitemaps from Caching: Sometimes, caching can affect the sitemap. You can add a filter to disable sitemap caching by adding the following code to your theme’s functions.php or rank-math.php file:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
-
Contact Support: If the above steps do not resolve the issue, please feel free to contact our support team for further assistance. You can reach out to them 24×7, 365 days a year for help with any issues you might face.
I hope these steps help resolve the 301 status pages in your sitemap. Thank you for reaching out with your concern!
Warm regards.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
How To Exclude Rank Math Sitemaps from Caching » Rank MathHello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
Please note that our plugin doesn’t remove redirected URLs from the sitemap automatically unless you delete those pages completely from your website or set them to Noindex.
However, if you’ve already deleted the pages or set them to Noindex but still appearing on your sitemap then 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/pipRDp2. 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 thanks for your replies, but the problem is that the URLs are redirections ( i change the URL of some pages) but in sitemap, there are 2 URLs of the same page (the old and the new)
Hello,
Could you please share such urls that are still there in the sitemap even after the slug of the pages are changed ?
Sharing the affected URLs with us will allow us to investigate the issue further for you.
We really look forward to helping you.
Thank you.
Here is the sitema generated by Rankmath:
https://www.greecefoodies.com/rz_listing-sitemap.xml
https://www.greecefoodies.com/sitemap_index.xmland here’s the redirections i want to remove from the sitemap:
https://www.greecefoodies.com/listing/santorini-winery-tour/
https://www.greecefoodies.com/listing/heraklion-food-tour/
https://www.greecefoodies.com/best-santorini-wine-tours/
https://www.greecefoodies.com/listing/
https://www.greecefoodies.com/listing/mykonos-cooking-class/
https://www.greecefoodies.com/listing/heraklion-private-food-tour/
https://www.greecefoodies.com/listing/heraklion-cooking-class/
https://www.greecefoodies.com/crete-travel-guide/
https://www.greecefoodies.com/flights-to-greece/
https://www.greecefoodies.com/athens-tours-2/Hello,
We checked the
https://www.greecefoodies.com/rz_listing-sitemap.xml
.The following URLs are not present in the sitemap and are redirecting to another URL
https://www.greecefoodies.com/best-santorini-wine-tours/
is redirecting tohttps://www.greecefoodies.com/santorini-wine-tours/
https://www.greecefoodies.com/greece-tours/
is redirecting tohttps://www.greecefoodies.com/listing/mykonos-cooking-class-2/
https://www.greecefoodies.com/crete-travel-guide/
is redirecting togreecefoodies.com/crete-food-guide/crete-travel-guide/
https://www.greecefoodies.com/flights-to-greece/
is redirecting tohttps://www.greecefoodies.com/flight-tickets-to-greece/
https://www.greecefoodies.com/athens-tours-2/
is redirecting tohttps://www.greecefoodies.com/athens-food-tours/
These are fine.
The following URLs are present in the sitemap and redirect
https://www.greecefoodies.com/listing/santorini-winery-tour/
is redirecting tohttps://www.greecefoodies.com/listing/santorini-wine-tour/
https://www.greecefoodies.com/listing/heraklion-food-tour/
is redirecting tohttps://www.greecefoodies.com/listing/heraklion-walking-food-tour/
https://www.greecefoodies.com/listing/
is redirecting tohttps://www.greecefoodies.com/greece-tours/
https://www.greecefoodies.com/listing/heraklion-private-food-tour/
is redirecting tohttps://www.greecefoodies.com/listing/heraklion-walking-food-tour/
https://www.greecefoodies.com/listing/heraklion-cooking-class/
redirects tohttps://www.greecefoodies.com/listing/cooking-lessons-in-heraklion/
Please follow the guide we shared here to clear the cache of the sitemap then check again.
We look 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.
-
The ticket ‘3xx in Sitemap issue’ is closed to new replies.