Rank Math WordPress Plugin Duplicate Sitemap Bug


A bug has been found in the popular WordPress SEO plugin, Rank Math, that causes it to generate duplicate sitemap files. This weird bug in how sitemaps are generated is similar to the one affecting Yoast, but the way RankMath handles it is different.

website sitemap

Sitemap is an important part of search engine optimization. It tells search engines which pages have been newly added and which pages have been updated in the site.

Sitemaps help a search engine prioritize its website crawling, alerting it to new content that needs to be indexed.

Due to the importance of sitemaps to SEO, it is a good practice that sitemaps are generated correctly.

of google developer page About Sitemap says:

“a site map A file where you provide information about your site’s pages, videos and other files and the relationships between them.

Search engines like Google read this file to crawl your site more efficiently.

A sitemap tells Google which pages and files in your site are important, and also provides valuable information about these files. For example, when the page was last updated and the page had an alternate language version.”

rank math xml sitemap bug

Rank Math also generates several XML sitemaps. In fact, it generates a possibly unlimited number of XML sitemaps.

For example, a site with a single sitemap for “Posts” will generate the following duplicate sitemap:

/post-sitemap.xml

/post-sitemap1.xml

But it will not generate zero numbered version, /post-sitemap0.xml

The same is true for duplicate sitemaps generated for pages:

/page-sitemap.xml
/page-sitemap1.xml

And then, like the “posts” sitemap, Rank Math does No Generate zero-numbered sitemap types: /page-sitemap0.xml

RankMath generates infinite number of sitemaps?

While RankMath does not generate a zero-numbered sitemap version, RankMath does generate what appears to be an almost infinite number of numbered XML sitemaps.

Ideally, RankMath should generate a 404 response code for a sitemap that does not exist.

But it appears that instead of generating a 404 response message RankMath is generating a 200 response code (meaning it is a request for a valid web page) and then generating an empty XML sitemap.

The following is a URL that I tested to see what RankMath generated:

https://rankmath.com/post-sitemap9.xml

This is what Rank Math shows:

Non-existent site map generated by Rank Math

Blank sitemap generated by Rank Math

How many sitemaps will Rank Math generate?

Obviously, RankMath can generate a lot of URLs, possibly an infinite amount of XML sitemap pages.

I was able to generate a blank sitemap with this url:

https://rankmath.com/post-sitemap9999999999999999999999999999999999999999999.xml

The interesting thing about the above sitemap is that the server generates a 200 header response code to the browser when serving that XML sitemap.

200 response code means there is no error.

I verified whether Rank Math has generated 200 response code through HTTPStatus website,

This shows that RankMath generates 200 response codes for pages that do not exist:

Rank Math Header Response Code

rank math sitemap redirection behavior

Other SEO plugins have a bug that creates duplicate sitemaps when a zero number is added to the end of the sitemap URL.

Rank Math however does not generate duplicate sitemaps with zero numbers.

When you make a request for a non-existent zero-numbered sitemap, the request triggers a redirect to the canonical sitemap.

A request for this non-existent sitemap:

/page-sitemap0.xml

Redirects to Canonical Sitemap:

/page-sitemap.xml

But arguably this isn’t the right way to handle sitemaps that don’t exist.

The correct server response should be to show the 404 page not found error response message, because that’s what happened, page not found.

The Yoast SEO plugin responds correctly by providing a 404 response code for XML sitemaps that do not exist (except for zero and 1-number variants).

I asked RankMath about it and they explained that it is not an issue.

Rank Maths:

“This is the same way WP Core handles on-site search: You will receive an HTTP 200 response for any arbitrary search query.

Unlike some sitemap plugins, Rank Math does not generate physical sitemap files in the server’s root directory.

Since these non-existent sitemap URLs don’t exist anywhere on the site, Google and other search engines will never crawl them, so this shouldn’t be a problem from an SEO standpoint.”

Rank Math duplicate site map bug

It is interesting that Rank Math, like some other SEO plugins, has a duplicate site map bug.

When it comes to optimizing a website for search engines, the goal is to be as perfect as possible. Anything that makes a website less than perfect can be considered a flaw when perfection is the goal.

Less than perfect optimization can lead to unexpected results.

Yoast is aware of the problem and is said to be working on fixing it. One would expect that the issue of duplicate site maps along with Rank Math will also be fixed at some point.

Citation:

Read Google’s web page about sitemaps

Learn about sitemaps





Source link

Leave a Comment