Sitemap
A sitemap is a form of SEO that allows for Search Engines to discover all pages of a website more efficiently
Formats
Best practice โ Machine readable sitemap.xml + Human readable sitemap.html
| No sitemap | Website pages well linked | Appropriate for small sites |
| HTML sitemap | An HTML page with all of the links | Human readable format |
| XML sitemap | sitemap.xml | Recommended |
| Feed sitemap | rss.xml ยท mrss.xml ยท atom.xml | Limited ยท Convenient format |
| Text sitemap | sitemap.txt | Limited ยท Simplest format |
Google Search Central โ Sitemap ยท Supported formats
No sitemap
A website well linked is equivalent to having a sitemap
It must be possible to navigate to every public page on your website from index.html
<a href='/other-page'>Link to other page</a>Google Search Central โ Do I need a sitemap?
HTML sitemap
An HTML sitemap is a page dedicated to linking every page on your website
- It is equivalent to having No sitemap
- It is not a Sitemap protocol standard
- It is human readable
Your HTML sitemap page must be linked from index.html
8 collapsed lines
<!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sitemap</title></head><body> <ul> <li><a href='/'>Home page</a></li> <li><a href='/blog'>Blog page</a></li> <li><a href='/about'>About page</a></li> </ul>2 collapsed lines
</body> </html> XML Sitemap
sitemap.xml is the standard Machine readable format
sitemap.xml must be specified in robots.txt or submited in Google Search Console
Deprecated attributes โ 2 collapsed lines
</url>Example โ 4 collapsed lines
<url> <loc>https://stephcraft.net/docs/sitemap</loc> <lastmod>2020-01-01</lastmod> </url> ...</urlset> XML Sitemap Index
sitemap.xml can be split into multiple files by defining it as a Sitemap Index
</sitemap>Example โ 4 collapsed lines
<sitemap> <loc>https://stephcraft.net/sitemap-core.xml</loc> <lastmod>2020-01-01</lastmod> </sitemap> ...</sitemapindex> Sitemaps.org โ Protocol ยท Index
Google Search Central โ Sitemap Index
Localization Sitemap Extension
sitemap.xml can specify translated page variants
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://stephcraft.net/blog</loc> <lastmod>2020-01-01</lastmod> />Example โ 5 collapsed lines
<xhtml:link rel="alternate" hreflang="fr" href="https://stephcraft.net/fr/blog" /> ... </url> ...</urlset>The Localization Sitemap Extension is developed by W3C
Media Sitemap Extensions
sitemap.xml can specify Images, Videos and News articles
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>https://stephcraft.net/docs/ai</loc> <lastmod>2020-01-01</lastmod> </image:image>Image Example โ 3 collapsed lines
<image:image> <image:loc>https://stephcraft.net/assets/vibe-code.png</image:loc> </image:image> ...Optional โ 16 collapsed lines
<video:family_friendly>yes</video:family_friendly> <video:restriction relationship="allow">IE GB US CA</video:restriction> <video:platform relationship="allow">web tv</video:platform> <video:tag>dev</video:tag> <video:tag>gaming</video:tag> <video:tag>web</video:tag> โA tag associated with the Video
- Many
<video:tag> can be present
... </video:video>Example Video โ 6 collapsed lines
<video:video> <video:thumbnail_loc>https://stephcraft.net/thumbs/0.png</video:thumbnail_loc> <video:title>Zombiecraft trailer</video:title> <video:description>An awesome video</video:description> <video:content_loc>http://streamserver.stephcraft.net/video0.mp4</video:content_loc> </video:video> ... <news:publication> </news:publication> </news:news>Example News โ 8 collapsed lines
<news:news> <news:publication> <news:name>The Example Times</news:name> <news:language>en</news:language> </news:publication> <news:publication_date>2020-01-01</news:publication_date> <news:title>Why Kotlin is the best programming language</news:title> </news:news> ... </url> ...</urlset>The Media Sitemap Extensions are developed by Google
Feed sitemap
Sitemaps.org โ Protocol ยท Syndication feed
Google Search Central โ Feed Sitemap
Google Search Central โ mRSS Sitemap
Text sitemap
sitemap.txt is the simplest format
sitemap.txt must be specified in robots.txt or submited in Google Search Console
https://stephcraft.net/bloghttps://stephcraft.net/docs/aihttps://stephcraft.net/docs/sitemap โList each url per line
... Sitemaps.org โ Protocol ยท Text file
Google Search Central โ Text Sitemap
Tools
Resources
Sitemaps.org
Google Search Central โ Sitemaps
Wikipedia โ Sitemaps
Wikipedia โ Sitemap
Frameworks
Astro Docs โ Sitemap
Next.js Docs โ Sitemap
TanStack Start Docs โ Sitemap