What Is an XML Sitemap?
An XML sitemap is a file that tells search engines like Google which URLs on your website should be indexed (added to its database of possible search results).
It may also provide additional information about each URL, including:
- When the page was last modified
- How often the page is updated
- The relative importance of the page
This information can help search engines crawl (explore) your site more effectively and efficiently. And better match your pages with relevant search queries.
That’s why XML sitemaps are important in search engine optimization (SEO).
What Does an XML Sitemap Look Like?
An XML sitemap (or sitemap.xml file) looks something like this:
It’s called an XML sitemap because it’s written in Extensible Markup Language (XML).
If you’re interested in the details, the main tags used are:
- <urlset>: Encloses all the tags for each sitemap
- <url>: Encloses all the tags for each URL
- <loc>: Specifies the page’s complete URL
- <lastmod>: Specifies when the page was last updated (optional)
- <changefreq>: Specifies how frequently the page is likely to change (optional)
- <priority>: Specifies the relative importance of the page from 0.0 to 1.0 (optional)
- <url>: Encloses all the tags for each URL