1. Home
  2. Knowledge Base
  3. SEO Suite
  4. Rank Math Sitemap Issues and Their Fixes

Rank Math Sitemap Issues and Their Fixes

Not able to use the Sitemap functionality of Rank Math? Is it throwing errors at you? Don’t worry, the issue is simpler than you think and the solution is even simpler.

1. The Sitemap is showing a blank or white page.

The first thing you need to do is determine whether you have a blank page or a white page. It sounds all the same but there is a difference. Check the source code of the blank/white page.

If the source code of the sitemap page is empty, there must be a conflict with another plugin or the theme. You can use the Health Check plugin to determine which plugin or theme is causing this. Another scenario is that you have a static file with the same name as you sitemap file (sitemap_index.xml). You should FTP into your server and remove the file.

2. Rank Math Does Not Create a Sitemap & Throws a 404 Error

If Rank Math doesn’t create a sitemap file or if you are getting a 404 error while trying to access your sitemap index, you may have to flush permalinks. Don’t be scared, it is fairly easy to do.

Simply head over to your WordPress admin area and go to Settings > Permalinks and hit the “Save Changes” button once even if you didn’t make any changes on the page.

This should fix the issue.

3. Why is there an ‘XML or text declaration not at the start of entity’ error inside Google Webmaster Tools?

There must be some white-spaces before the XML Sitemap’s source code.

blank-space-sitemap

This might be added by a blank line/space in your wp-config.php file or your theme’s functions.php file. If there is no such blank space in your wp-config.php or functions.php file, check for a plugin conflict using the Health Check plugin.

Also, make sure your cache is disabled as it is highly likely that the cache is interfering with the working of Sitemap functionality of Rank Math.

4. I am getting a `Missing XML tag` error

This is most likely because:

  1. You have no content on your website
  2. You have blocked all post/pages from appearing in your sitemap

First, one can be fixed by adding some content to your website.

The second one can be fixed by making sure you don’t block useful posts/pages/taxonomies from being included in your sitemap. You can do so by going to Rank Math > Sitemap Settings and checking option for each type of post/taxonomy.

5. My Sitemap is not working on my Apache Web-Server.

Rank Math creates a virtual Sitemap dynamically when you enable that module. We rely on redirects enabled by your server software to accomplish that. If the Sitemap doesn’t work, you may have to add some rewrite rules manually.

To ensure you need to add these rewrite rules, go to domain.com?sitemap=1. If it loads your sitemap, that means you need to add the rewrite rules.

Check your .htaccess and add the following code:

# START of Rank Math Sitemap Rewrite Rules
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
# END of Rank Math Sitemap Rewrite Rules

6. My Sitemap is not working on my Nginx Web-Server.

Rank Math creates a virtual Sitemap dynamically when you enable that module. We rely on redirects enabled by your server software to accomplish that. If the Sitemap doesn’t work, you may have to add some rewrite rules manually.

To ensure you need to add these rewrite rules, go to domain.com?sitemap=1. If it loads your sitemap, that means you need to add the rewrite rules.

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

Don’t worry about these. It just means you have opened those links in your browser. Google only sees the XML source code, they don’t see the formatting or the colors. Those are just to make the sitemap look pretty.

8. The ‘Detected’ date is not today’s. What should I do?

My Sitemap is not using the correct URL format.

Your sitemap follows the same protocol you set for your WordPress website. If you selected a `www` version, the sitemap will be available at www.domain.com/sitemap_index.xml. If you want to change that, you have to change the website address at WordPress Dashboard > Settings > General and changing www version of your website to the non-www version.

9. Why am I getting “Your file appears to be an HTML page” error in Google Webmaster Tools?

Make sure that you submitted the correct XML sitemap to Google. You should submit the sitemap available on your website at https://domain.com/sitemap_index.xml

If you are sure you submitted the correct URL but you are still facing this error, check for a plugin conflict using Health Check plugin.

If you are running W3 Total Cache along with Rank Math on your website, make sure you create another user agent group and add the ‘googlebot’ user agent to it.

10. My Sitemap URL is blocked by robots.txt

This usually happens because of unintended rules in the robots.txt file or because of some weird plugin conflict. Make sure you don’t have any rules in your actual robots.txt file or the virtual robots.txt file add by Rank Math by going to Rank Math > General Settings > robots.txt

11. Google Can’t Find my Sitemap.

If you are getting a 404 error and Google can’t access your sitemap index, you may have to flush permalinks. Don’t be scared, it is fairly easy to do.

Simply head over to your WordPress admin area and go to Settings > Permalinks and hit the “Save Changes” button once even if you didn’t make any changes on the page.

This should fix the issue.

If you are still facing any sort of issue with the Sitemaps, open a new ticket here so that our staff can help.

Was this article helpful?

Still need help?

?

Submit Your Question

Please give us the details, our support team will ge back to you.

Open Ticket

Related Articles