Rank Math Sitemap Issues and Their Fixes


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





Rank Math Sitemap Issues and Their Fixes





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.


Post a Comment

4 Comments

  1. Wow, incredible blog format! How lengthy have you ever been running a blog
    for? you make running a blog glance easy. The total look of your site is
    wonderful, as neatly as the content material!

    ReplyDelete
  2. Howdy! I could have sworn I've been to your blog before but after
    going through many of the articles I realized it's new to me.
    Anyhow, I'm definitely delighted I stumbled upon it and I'll be
    book-marking it and checking back regularly!

    ReplyDelete
  3. Wow, fantastic blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your web site is magnificent, as well as the
    content!

    ReplyDelete
  4. whoah this weblog is great i love studying your articles. Stay
    up the great work! You recognize, lots of individuals are searching around for this info, you could aid them greatly.

    ReplyDelete