1

I'm currently building a sitemap for my web app.

Note: my app is a single page app built with React and Firebase.

Basically I wan to index blogPost and product pages. So I intend to generate my sitemap dynamically (on server). It's a small website (around 500 pages).

I want to build something like this:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>
      https://www.myproject.org/blog/some-blog-post-slug
    </loc>
    <lastmod>2019-11-14T20:22:43.502+00:00</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>
      https://www.myproject.org/dp/some-product-slug
    </loc>
    <lastmod>2019-11-15T13:08:52.127+00:00</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

And I keep the following properties in my database, both for blogPosts and products:

createdAt: <Timestamp>
lastModifiedAt: <Timestamp>  // UPDATED EVERYTIME I UPDATE THE RECORD

And I'm thinking about using my lastModifiedAt value as the <lastmod> tag for the sitemap.

So far, so good! Everytime I update my blogPost or product objects in my database. The next time the sitemap is requested, the new modifiedDate will show on those that have been changed.

QUESTION

But what if I make a change not in the database itself, but in the way I render all the product pages, for example.

Imagine that I've added some structured data tags to display rich results on google, with price, reviews etc. So my product info is the same, but from that point on, all of my product pages will render those extra tags that I need to be re-indexed.

Example (add a structured data tag with the product price):

 <div property="schema:price" content="119.99"></div>

In that situation, will I have to update all <lastmod> for all the products? How Google will know that it needs to re-crawl those pages and be able to see the structured data tags?

What if I change only the styles for the productPages? Do I have to update the <lastmod> for every product in this case?

1

You should remove all your <lastmod>, <changefreq>, and <priority> data from your sitemaps. Google says they don't use it. It is just extra bloat making your sitemap files larger with no benefit to you.

In fact, sitemaps have almost no SEO benefit. See The Sitemap Paradox. Google will crawl pages listed only in a sitemap, but it usually chooses not to index them, and certainly not rank them well. It is always better to link your pages from other pages compared to just putting them in a sitemap. The best that you can get from sitemaps is extra data in Google Search Console.

Googlebot automatically re-crawls content based on how important it is (PageRank) and how often it has changed in the past. There is nothing you need to do to get Googlebot, to re-crawl. It will come back and pick up your changes eventually.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.