Site maps for search engines and for people
People use the words "site map" for two separate things.
The first is a file that lists a website's pages for search engines to read. The other is a page that lists them for the people visiting.
Does a small website need a sitemap file?
Google counts a site as small when it has about 500 pages or fewer. Only the pages you want in search results go towards that number.
A small site whose important pages can all be reached by following links from the home page may not need a sitemap, Google says. On a well-linked site, Google can usually find most pages by itself.
Google suggests a sitemap where a site is large, or new with few links from other sites, or holds a lot of video and images.
If you edit your pages through a content management system, Google says the system has probably made a sitemap available already.
What goes in the file
The sitemap format is set out at sitemaps.org. The file is XML, saved with UTF-8 encoding.
Every page gets its own <url> entry. Inside it, a <loc> tag holds the page's address, and an optional <lastmod> tag holds the date the page last changed.
Google asks for complete addresses beginning with https://, and for lastmod dates that match the last significant update to each page. It ignores the <priority> and <changefreq> tags.
How big one file can be
Google gives a limit of 50,000 URLs or 50MB, uncompressed, for each sitemap file.
A larger site splits its list across several sitemaps. It can then submit one sitemap index file that points to them all.
Telling search engines where the file is
Google recommends putting the sitemap in the site's root folder, where it covers every file.
One line in your robots.txt file tells Google where to look:
Sitemap: https://example.com/my_sitemap.xml
You can also send it to Google through the Sitemaps report in Search Console. The report shows when Google read the file and any errors it ran into. Google treats a submitted sitemap as a hint about your pages.
Bing Webmaster Tools keeps its own help on sitemaps, linked below.
A site map page for visitors
The W3C's accessibility guidance has a technique for this, known as G63. It describes a site map as "a web page that provides links to different sections of the site".
Under G63, each page listed in the site map links back to it. That way a visitor can reach the overview from anywhere it covers.
The W3C asks for the site map to be updated whenever the site is. A good one links to every section, follows the site's own structure, and has no broken links.
Useful links
- What Is a Sitemap (Google Search Central)
- Build and Submit a Sitemap (Google Search Central)
- sitemaps.org Protocol (sitemaps.org)
- Sitemaps (Bing Webmaster Tools Help)
- G63: Providing a site map (W3C Web Accessibility Initiative)