What Is an XML Sitemap and Do You Need One?
An XML sitemap is a file that lists the important URLs on your website. It is written for search engines rather than people, and it helps them discover and crawl your pages. It is different from the planning document described in our article on structuring your pages.
What it looks like
The file is usually located at yourdomain.com/sitemap.xml. Each entry contains a page address and, optionally, the date it was last modified. Most website platforms and plugins generate it automatically.
Do you need one?
Search engines can often find pages by following links, so a sitemap is not always essential for a small, well-linked site. It is most useful when:
- Your site is large or has many pages.
- Your site is new and has few links from other sites.
- Some pages are not well connected by internal links.
- You publish new content often, such as news or a blog.
Even for a small site, it is cheap to have and rarely does any harm, so most sites include one.
What to include
List pages you want people to find in search: your main pages, service pages, articles, and products. Leave out:
- Pages blocked from indexing
- Duplicate or parameter-based URLs
- Redirected pages and error pages
- Thank-you pages and admin areas
Only include the canonical, final version of each URL. A clean sitemap helps crawlers focus.
How to create it
- If you use a platform like WordPress or a hosted builder, it likely has a built-in sitemap or a plugin to create one.
- For a custom site, a build script or generator can produce it.
- Very small sites can use a simple handwritten file, though automation avoids mistakes.
How to submit it
- Make sure the sitemap works by visiting it in your browser.
- In Google Search Console, open the Sitemaps section and enter the sitemap's address.
- Check for errors and see how many pages Google has discovered.
You can also point to it from your robots.txt file with a Sitemap: line.
Keep it updated
Update the sitemap whenever pages are added or removed. If it is generated automatically, check periodically that it still reflects your site, especially after a redesign or migration.
What a sitemap does not do
It does not guarantee a page will be indexed or ranked. It is a helpful hint, not a command.
The bottom line
Create an XML sitemap, keep it clean, and submit it. It is a small step that helps search engines find your work.