0

When WordPress website Home Page displays the latest posts, the Rank Math SEO Plugin Sitemap contains the Home Page URL (https://website.com/) twice. In "page_sitemap.xml" and "post_sitemap.xml".

I created a static page and blog page as a test, and from settings I selected "Home Page as Homepage" and "Blog Page as Posts Page". The same thing happened, the Blog Page URL (https://website.com/blog/) duplicated twice in "page_sitemap.xml" and "post_sitemap.xml".

Logically the Page URL must be in "page_sitemap.xml" only. Why this is happening and If this is wrong, could you please guide me to the best practices to do?

isathemes
  • 1
  • 1

1 Answers1

0

When you see your homepage both at page-sitemap and post-sitemap, that might be happening because you've selected WordPress Dashboard > Settings > Reading > Your homepage displays to your latest posts. The sitemap should have chosen a static page but choosing that option will show the latest posts on that page. So the homepage is both a homepage (included in page-sitemap) and a posts page (included in post-sitemap), and logically that's correct.

But It’s fine, and that shouldn’t cause any SEO issues, as it simply tells Google to crawl the site. But at some point, Google will count the same URL in different sitemap files separately, which could sometimes lead to the number of URLs in your sitemaps being less than the number of URLs counted as being indexed. The same URL in multiple sitemaps is counted separately, which is why you could see something like this.

However, creating a static page for the homepage and a blog page should work.

In your case, this might be happening due to a caching issue. You can try clearing the sitemap cache and excluding the sitemap from caching.

#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/

3. If the above steps doesn't seem to work, kindly apply the following filter code to your site.

`add_filter( 'rank_math/sitemap/enable_caching', '__return_false');`

Here's how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/