Hello,
Thank you for contacting Rank Math.
You seem to have nginx server, please check your Nginx config file and add the following code:
# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# END Nginx Rewrites for Rank Math Sitemaps
Once done, please follow these steps:
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/
That should fix the issue. Please let me know if that does not. We are here to assist.
Thank you, but before doing anything, I’ll let you know. Clicking on the sitemap link now works. Is that correct? Yesterday I deleted the robots.txt file from my server. The plugin generated a new one. Then I created a new robots.txt. with the same thing that I put and then it worked. Is this correct?
Hello,
Glad to hear the issue is resolved.
You should still consider excluding your sitemaps from being cached as this is known to cause issues with updating the sitemap.
By default Rank math generates a virtual robots.txt, which is actually recommended unless you want to add custom rules. Since it’s working, I would advise to give it sometime to ensure the issue is completely resolved and if it is then let us know.
Hope this helps you. Thank you
Hello again!
Can you tell me what Disallow: / go-to / means after the robot.txt sitemap.
I have drafted my robots.txt file from the domain root, I have created the Rank Math virtual and I see this:
User-agent: *
Disallow: / wp-admin /
Allow: /wp-admin/admin-ajax.php
Sitemap: https://site.com/sitemap_index.xmlDisallow: / go-to /
It is right? What does the disallow go to mean?
Thanks a lot
Hello,
You should change the rules to be as follows:
User-agent: *
Disallow: / wp-admin /
Allow: /wp-admin/admin-ajax.php
Disallow: / go-to /
Sitemap: https://site.com/sitemap_index.xml
Disallow: / go-to /
keeps bot from crawling the specified path and this is not added by Rank math. If you have not added the Disallow manually, then it is bein added by a plugin on your site or the theme
I also recommend that you check this Google article: https://developers.google.com/search/reference/robots_txt on Robots.txt specifications.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks but I don’t know how to do it. I don’t want disallow: / go-to / to appear and it gets automatically. How is it removed?
Hello,
The easiest way to edit your robots.txt is by accessing it from your FTP or your web hosting’s File Manager. You can also edit it from Rank Math > General Settings > Edit robots.txt
I hope this resolves your issue.
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.