A sitemap tells search engines and visitors what pages exist on your site
A sitemap is a file that lists all the pages on your website in a format that search engines can read. It works like a table of contents — it shows Google, Bing, and other search engines where to find every page, how often you update them, and how important each one is relative to the others. You can create a sitemap by hand if your site has fewer than 50 pages, or use a tool to generate one automatically if you have more.
Search engines can find pages without a sitemap by following links from one page to another, but a sitemap makes the job faster and more complete. It is especially useful if you have pages that are not linked from your main navigation, if you publish content infrequently, or if your site structure is complex.
Key Takeaways
- A sitemap is an XML file that lists your website's pages and tells search engines when they were last updated and how important they are.
- You can create a sitemap manually in a text editor for small sites, or use a free tool like Screaming Frog, XML-Sitemaps.com, or your content management system's built-in generator.
- After you create your sitemap, save it as sitemap.xml in your website's root directory and submit it to Google Search Console and Bing Webmaster Tools.
- A sitemap should include the full URL of every page you want indexed, the date it was last modified, how often it changes, and its priority relative to other pages.
- You should update your sitemap whenever you add, remove, or significantly change pages on your site.
The XML format search engines expect
Sitemaps are written in XML, which is a straightforward text format that both humans and machines can read. You do not need to know XML well — the structure is straightforward and repeats the same pattern for each page.
Here is what a basic sitemap looks like:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/</loc> <lastmod>2024-01-15</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> <url> <loc>https://example.com/about</loc> <lastmod>2024-01-10</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset>
Each page is wrapped in <url> tags. Inside, <loc> is the full web address, <lastmod> is the date you last changed it (in YYYY-MM-DD format), <changefreq> tells search engines how often the page typically changes (use values like daily, weekly, monthly, or yearly), and <priority> is a number from 0.0 to 1.0 that tells search engines which pages matter most to you. Your homepage is usually 1.0; less important pages might be 0.5 or 0.6.
Creating a sitemap by hand for small sites
If your site has fewer than 50 pages, you can write the sitemap yourself in a text editor. Open Notepad, TextEdit, or any plain-text editor and paste the XML structure above. Replace example.com with your actual domain, add one <url> block for each page on your site, and fill in the real dates and priorities.
Save the file as sitemap.xml — the name matters, and it must be plain text, not a Word document or rich-text file. If you use TextEdit on Mac, go to Format menu and choose "Make Plain Text" before saving. On Windows, Notepad saves as plain text by default.
The advantage of doing this by hand is that you control exactly what goes in the sitemap and you learn how it works. The disadvantage is that you have to update it every time you add or remove a page, and it is straightforward to make a typo that breaks the whole file.
Using a sitemap generator tool
For larger sites or if you want to avoid manual work, use a free sitemap generator. XML-Sitemaps.com is the simplest: enter your domain name, click "Start", and it crawls your entire site and builds a sitemap for you. read the file and upload it to your server. The tool works for sites up to 500 pages on the free version.
Screaming Frog SEO Spider is more powerful and gives you more control. read and install the desktop process, enter your domain, and let it crawl your site. You can then exclude pages you do not want indexed, set priorities and change frequencies manually, and export as XML. The free version crawls up to 500 URLs; the paid version has no limit.
If you use a content management system like WordPress, Shopify, Wix, or Squarespace, check whether it has a built-in sitemap generator. WordPress plugins like Yoast SEO and Rank Math create and update sitemaps automatically. Shopify generates a sitemap at yourstore.myshopify.com/sitemap.xml without any setup. Wix and Squarespace do the same — your sitemap is already live.
Uploading and submitting your sitemap
Once you have your sitemap file, upload it to the root directory of your website — the top-level folder where your homepage lives. If you use FTP or SFTP to manage your site, connect and drag sitemap.xml into the root. If you use a hosting control panel like cPanel, use the File Manager to navigate to the root and upload there. If you use a CMS, the sitemap is usually already in the right place.
After uploading, tell search engines where to find it. Go to Google Search Console (search.google.com/search-console), sign in with your Google account, select your website, and click "Sitemaps" in the left menu. Paste your sitemap URL (usually https://yoursite.com/sitemap.xml) and click Submit. Do the same in Bing Webmaster Tools (bing.com/webmasters) — click "Sitemaps" and add your URL.
You can also add a line to your robots.txt file pointing to the sitemap. Open or create a file called robots.txt in your root directory and add this line:
Sitemap: https://yoursite.com/sitemap.xml
This tells all search engines where your sitemap is without requiring you to submit it manually to each one.
Keeping your sitemap current
A sitemap is only useful if it stays accurate. If you use a CMS with automatic sitemap generation, it updates itself whenever you publish or delete a page — you do not have to do anything. If you created your sitemap by hand or with a one-time tool, update it whenever your site changes significantly.
Add new pages within a day or two of publishing them. Remove pages that no longer exist. Update the <lastmod> date whenever you make a meaningful change to a page's content — fixing a typo does not require an update, but rewriting a section does. If you use a tool like Screaming Frog, re-run it every month or quarter to catch changes you might have forgotten.
If your sitemap is very large (more than 50,000 URLs), you can split it into multiple files and create a sitemap index that lists them all. This is rare for most websites, but the XML-Sitemaps.com tool handles it automatically if needed.
Common mistakes to avoid
Do not include URLs that return errors or redirect elsewhere — search engines will waste time crawling them. If a page is gone, remove it from the sitemap rather than leaving it in. Do not set every page to priority 1.0; priorities only matter when you are comparing pages on your own site, and setting everything to maximum makes the field meaningless. Use realistic change frequencies — if a page has not changed in six months, do not say it changes weekly.
Do not forget to submit your sitemap to Google Search Console and Bing Webmaster Tools. Uploading it to your server is not enough; search engines need to know it exists. Do not use relative URLs like /about — always use the full URL including https://. Do not include pages that are blocked by your robots.txt file or marked with noindex tags; search engines will ignore them anyway.
Frequently Asked Questions
Do I need a sitemap if I have a small website?
Not strictly — search engines can find your pages by following links. But a sitemap helps them find pages faster and ensures nothing gets missed, especially if you do not update often or have pages that are not linked from your main menu. It takes five minutes to create one, so it is worth doing.
What is the difference between a sitemap and a robots.txt file?
A robots.txt file tells search engines which pages to crawl and which to skip. A sitemap tells them which pages exist and how important they are. You can have both — they serve different purposes and work together.
How often should I update my sitemap?
If your CMS generates it automatically, it updates itself whenever you publish or delete a page. If you created it manually, update it whenever you add or remove pages, or at least once a month if your site changes regularly. Resubmit it to Google Search Console after major updates so Google knows to re-crawl.
Can I have more than one sitemap?
Yes. If your site is very large, you can create separate sitemaps for different sections — one for blog posts, one for products, one for static pages — and list them all in a sitemap index file. Most tools handle this automatically if you exceed the URL limit.
What if my sitemap is invalid or has errors?
Google Search Console will tell you if your sitemap has problems — it shows errors in the Sitemaps section. Common issues are typos in URLs, incorrect date formats, or URLs that do not actually exist. Fix the errors in your sitemap file, re-upload it, and resubmit it to Search Console.