Ad

Multiple Sitemaps Within Single Sitemap File

- 1 answer

I have a site with a sitemap, around 150 entries to URLs that are static on the site. lastmod element is set to 2012. This sitemap was updated approximately a year ago.

The last couple of lines of this SM file are:

  <url><loc>http://example.com/sitemap2.xml</loc><changefreq>daily</changefreq></url>
  <url><loc>http://example.com/siteMap3.xml</loc><changefreq>daily</changefreq></url>
</urlset>

Sitemap 2 contains the same logic but with links targetting specific products and sitemap 3 does the same but aimed towards categories. These two are generated daily.

The main sitemap.xml is registered. An external SEO advisor ran a test and advised the sitemap is not updated and does not list the links for products and categories.

How could I check if what he has said is correct? If he is correct what could I have done wrong here?

Ad

Answer

Having multiple sitemaps is fine, but you should link them from a sitemap index file.

For your case, you could use something like this:

<?xml version="1.0" encoding="UTF-8"?>

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <sitemap>
      <loc>http://example.com/sitemap1.xml</loc>
      <lastmod>2012</lastmod>
   </sitemap>

   <sitemap>
      <loc>http://example.com/sitemap2.xml</loc>
      <lastmod>2016-10-11</lastmod>
   </sitemap>

   <sitemap>
      <loc>http://example.com/sitemap3.xml</loc>
      <lastmod>2016-10-11</lastmod>
   </sitemap>

</sitemapindex>

Instead of changefreq, you have to use lastmod, which takes the date of the last modification of the sitemap (not of the sitemap entries).

This sitemap index file can then be linked in your robots.txt (and/or be submitted to search engines).

Ad
source: stackoverflow.com
Ad