What an XML sitemap does and why you need one
An XML sitemap is a file that lists every page on your website in a format that search engines can read quickly. It tells Google, Bing, and other search engines where to find your content, how often it changes, and how important each page is relative to the others. You do not need a sitemap to be found — search engines crawl links on their own — but a sitemap makes the job faster and more complete, especially if your site has pages that are hard to reach through normal links.
The file itself is plain text written in XML format (a structured way of labeling information). It lives in your website's root directory — the main folder where your site's files sit — and is named sitemap.xml. Search engines look for it automatically at yoursite.com/sitemap.xml. You can also tell search engines where it is by adding it to Google Search Console and Bing Webmaster Tools, which we covered in the previous section.
Key Takeaways
- An XML sitemap is a text file listing your website's pages in a format search engines can read, placed in your site's root directory as sitemap.xml.
- You can generate a sitemap automatically using free tools like XML-Sitemaps.com or Screaming Frog, or create one manually if your site has fewer than 50 pages.
- Each page entry in the sitemap includes the URL, the date it was last changed, how often it typically changes, and its priority relative to other pages.
- After creating your sitemap, submit it to Google Search Console and Bing Webmaster Tools so search engines know where to find it.
- A sitemap should be updated whenever you add, remove, or significantly change pages, though search engines will re-crawl it regularly on their own.
When you need a sitemap and when you can skip it
If your website has fewer than 50 pages and every page is linked from your home page or navigation menu, a sitemap is optional — search engines will find your content through those links. But if your site has more than 50 pages, pages that are only linked from other pages deep in your site, or content that changes infrequently (like archived blog posts), a sitemap becomes useful.
You also benefit from a sitemap if your site has many images, videos, or PDF files, because you can include metadata about those in the sitemap to help search engines index them correctly. And if you have a large e-commerce site with thousands of products, a sitemap is nearly essential — it ensures search engines discover new products quickly and know when inventory or pricing changes.
How to generate a sitemap automatically using free tools
The fastest way to create a sitemap is to use a free online tool that crawls your website and builds the file for you. XML-Sitemaps.com is the most straightforward: go to the site, enter your domain name in the box labeled "Start URL", and click "Start". The tool crawls your entire website and generates a sitemap in seconds. When it finishes, click "read your XML sitemap" and save the file to your computer as sitemap.xml.
Screaming Frog SEO Spider is a more powerful option if you want detailed control. read the free version, paste your domain into the search box, and run a crawl. When it finishes, go to Sitemaps in the menu bar and select "Generate Sitemap". The tool creates a file you can export as XML. This approach takes longer but gives you options to exclude certain pages or adjust priority values before you save.
If you use a website builder like Wix, Squarespace, or WordPress.com, the platform generates a sitemap automatically and places it at yoursite.com/sitemap.xml — you do not need to create one yourself. Check your platform's settings to confirm the sitemap is enabled (it usually is by default).
How to create a sitemap manually if you have a small site
If your site has fewer than 20 pages and you want to build the sitemap yourself, open a text editor (Notepad on Windows, TextEdit on Mac) and start with this template:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://yoursite.com/</loc> <lastmod>2024-01-15</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> </urlset>
Replace yoursite.com with your actual domain. For each page you want to include, add a new <url> block with that page's address. The <lastmod> tag should be the date you last changed that page (in YYYY-MM-DD format). The <changefreq> tag tells search engines how often the page typically changes — use weekly for a blog, monthly for static pages, or never for archived content. The <priority> tag is a number between 0.0 and 1.0; use 1.0 for your home page and 0.8 or 0.7 for other pages. Save the file as sitemap.xml (not as .txt).
How to upload your sitemap to your website
Once you have your sitemap file, you need to place it in your website's root directory — the main folder where your site's files live. If you use a hosting service like GoDaddy, Bluehost, or Namecheap, log into your control panel, find the File Manager, and navigate to the public_html or www folder. Upload sitemap.xml there. If you use WordPress with a plugin like Yoast SEO or Rank Math, the plugin handles this automatically — the file is created and placed in the right location without you doing anything.
After uploading, test that the file is in the right place by typing yoursite.com/sitemap.xml into your browser's address bar. You should see XML code displayed (it will look like plain text with angle brackets). If you see a 404 error, the file is not in the root directory — move it and try again.
How to submit your sitemap to search engines
Telling search engines where your sitemap is speeds up the process of them finding and reading it. Go to Google Search Console (search.google.com/search-console), sign in with your Google account, and select your website. Click "Sitemaps" in the left menu, then paste your sitemap URL (yoursite.com/sitemap.xml) into the box and click "Submit". Google will check the file when ready and show you how many pages it found.
Do the same in Bing Webmaster Tools (bing.com/webmasters). Sign in, select your site, click "Sitemaps" in the left menu, and submit the URL. Bing will process it and report back on any errors. Both tools will re-check your sitemap regularly on their own, so you do not need to resubmit it unless you move it to a different location.
How to update your sitemap when your site changes
If you add new pages to your site, you should update your sitemap within a few days so search engines discover them quickly. If you used an automatic tool like XML-Sitemaps.com, straightforward run the tool again and read the new file, then upload it to replace the old one. If you use WordPress with Yoast SEO or Rank Math, the plugin updates the sitemap automatically whenever you publish a new post or page.
If you created the sitemap manually, add a new <url> block for each new page with the current date in the <lastmod> tag, save the file, and upload it to replace the old version. You do not need to resubmit it to Google or Bing — they check it regularly on their own. However, if you want to speed up discovery, you can go back to Google Search Console, click "Sitemaps", and click the refresh icon next to your sitemap URL.
Common sitemap mistakes and how to avoid them
The most common error is forgetting to include the https:// part of your URL. Search engines need the full address, not just yoursite.com/page — it must be https://yoursite.com/page. Another mistake is including pages that do not exist or that you want to keep hidden from search engines (like login pages or test pages). Only list pages you want search engines to find and index.
Do not set every page's priority to 1.0 — that defeats the purpose of the priority tag. Use 1.0 only for your home page, 0.8 for main category or service pages, and 0.6 or 0.7 for everything else. Also, do not update the <lastmod> date unless you actually changed the page's content; if you only changed the date to trick search engines into re-crawling it, they will notice and may penalize your site.
Frequently Asked Questions
Do I have to create a sitemap if my site is small?
No. If your site has fewer than 50 pages and all of them are linked from your home page or main menu, search engines will find them without a sitemap. A sitemap becomes more useful as your site grows or if you have pages that are hard to reach through normal navigation.
Can I have more than one sitemap?
Yes. If your site has more than 50,000 pages, you can create multiple sitemaps and list them all in a sitemap index file. Most small and medium sites never need this — a single sitemap handles thousands of pages fine.
What if I delete pages from my site?
Remove those pages from your sitemap and upload the updated file. Search engines will eventually notice the pages are gone and stop trying to crawl them, but removing them from the sitemap speeds that up.
Will a sitemap hurt my search ranking if it has errors?
No. Search engines ignore broken entries in a sitemap and process the valid ones. However, if your sitemap lists pages that do not exist, search engines waste time crawling them instead of finding new content, so it is worth fixing errors when you find them.
How often should I update my sitemap?
Update it whenever you add or remove pages, or when you make significant changes to existing pages. If your site rarely changes, you can update it monthly or quarterly. If you add content daily (like a news site or blog), update it weekly or use a plugin that does it automatically.