What Is an XML Sitemap?
What an XML Sitemap Contains
An XML sitemap is a file, written in the XML format, that lists the URLs of a website the owner wants search engines to know about. Each entry is wrapped in a set of tags, so software can read the list without parsing a web page.
A basic entry includes a loc element, which holds the full address of the page. It can also include a lastmod element with the date the page was last changed. Google uses lastmod when it is consistently accurate, but it ignores the priority and changefreq values that some older examples include. Sitemaps are usually placed at the root of the site and can be named in the robots.txt file.
Size Limits, Sitemap Index Files and Specialized Sitemaps
Each sitemap file is limited to 50,000 URLs and 50 MB when uncompressed. Larger sites split their list into several files and publish a sitemap index file, which is itself an XML file that lists each sitemap. Sitemap files can be compressed with gzip to reduce transfer size, though the limits still apply to the uncompressed content.
Specialized sitemaps also exist for images, videos and news content. They extend the same idea with additional tags, so search engines can discover media files that a normal crawl might miss.
Which Sites Benefit From a Sitemap
A sitemap is not required for every website. A small, well-linked site where every page is reachable through navigation may never need one. Sitemaps tend to matter more in several situations:
- Large sites with many pages, especially where some pages sit deep in the structure.
- New sites that have few external links pointing to them.
- Sites with frequently changing content, such as news or listings.
- Sites with rich media that should be discoverable in image or video search.
A sitemap does not replace good internal linking, and it does not guarantee that listed pages will be indexed. It is a list of what exists. The importance of each page is still judged on its content and links.
Frequently asked questions
Does an XML Sitemap Improve Rankings?
Not directly. A sitemap affects discovery, not the position of a page in results. It can help new or deeply buried pages get found sooner, which means they can be considered sooner. Rankings still depend on the content and links of each page, so a sitemap cannot make weak pages rank well.
What Is the Difference Between an XML Sitemap and an HTML Sitemap?
An XML sitemap is written for search engines and is not meant to be read by visitors. An HTML sitemap is a regular web page with links that people can browse. Both list pages, but they serve different audiences. The comparison is covered in HTML sitemap vs XML sitemap.