Hello,
Thank you for contacting Rank Math, and sorry for any inconvenience caused.
Please add this filter to your website:
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here is a guide you can follow to add the filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Once done, clear your website cache and check the sitemap.
Let us know how it goes.
We are here to assist you.
Hi Anas,
Thanks for your reply. I’ve tried the code (through method 1 on the link), but the error remains.
Is there any other option that i could try?
Thanks,
Daniel
Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
I’ve checked your sitemap at /?sitemap=1 and it seems to be working fine if you view the source code of the page.
Please try rewriting the /?sitemap=1 to sitemap_index.xml in order to fix this issue. Here’s a guide below that you may follow to learn how you can conduct a rewrite operation on your web server:
For Nginx:
https://rankmath.com/kb/sitemap-404-error/#num-3-2-1-add-rewrite-rules-to-nginx-server
For Apache:
https://rankmath.com/kb/sitemap-404-error/#num-3-2-2-add-rewrite-rules-to-apache-web-server
If that seems to be complicated for you, you may also ask your hosting provider to do that for you.
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.