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. 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 others. Without a sitemap, search engines have to discover your pages by following links — which works, but slowly, especially for new sites or pages buried deep in your navigation.
A sitemap does not may provide your pages will rank higher. It simply makes sure search engines find and index all your pages, including ones that might not have many internal links pointing to them. For a small website with fewer than 50 pages, a sitemap is helpful but not critical. For larger sites, e-commerce stores, or sites with pages that rarely change, a sitemap becomes genuinely useful.
The file itself is plain text written in XML format — a structured way of organizing information that machines can parse. You create it once, upload it to your server, and then tell search engines where to find it. Search engines check it periodically to see what has changed.
Key Takeaways
- An XML sitemap is a text file listing your website's pages that you upload to your server and submit to Google Search Console and Bing Webmaster Tools.
- You can generate a sitemap automatically using free tools like XML-Sitemaps.com or Screaming Frog, or manually create one if your site has only a handful of pages.
- The sitemap file must be named sitemap.xml and placed in your website's root directory so search engines can find it at yoursite.com/sitemap.xml.
- After uploading your sitemap, you must submit it through Google Search Console and Bing Webmaster Tools so search engines know to check it.
- Update your sitemap whenever you add, remove, or significantly change pages, or set up automatic updates if your site uses a content management system.
Generating a sitemap with a free online tool
The fastest way to create a sitemap is to use a free generator tool. XML-Sitemaps.com is the most straightforward: you enter your website's URL, click "Start", and the tool crawls your site and builds the sitemap for you. The process takes anywhere from a few seconds to a few minutes depending on how many pages you have.
Once the scan finishes, you will see a list of all the pages the tool found. Review this list to make sure nothing is missing and nothing unwanted is included — for example, you might not want your login page or thank-you pages indexed. If something is wrong, you can edit the list before downloading. Then click "Download your XML sitemap" and save the file to your computer as sitemap.xml.
If your site is very large or has complex navigation, Screaming Frog (free version) is more powerful. Download and install the software, enter your website URL, and let it crawl. The free version handles up to 500 pages. When the crawl finishes, go to Sitemaps > XML Sitemap and export the file.
Creating a sitemap manually for small websites
If your website has fewer than 20 pages, you can write the sitemap by hand. Open a text editor — Notepad on Windows or TextEdit on Mac work fine — and start with this structure:
<?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 https://yoursite.com/ with your actual website URL. The lastmod tag is the date you last updated that page (use YYYY-MM-DD format). The changefreq tag tells search engines how often the page typically changes — use "weekly" for pages you update regularly, "monthly" for pages that rarely change, or "never" for pages that are finished. The priority tag is a number from 0.0 to 1.0 indicating how important the page is relative to others on your site — use 1.0 for your homepage and 0.8 or 0.7 for other pages.
Add one <url> block for each page on your site. When you are done, save the file as sitemap.xml (not sitemap.xml.txt — make sure the extension is correct). If you are using Notepad, go to File > Save As, choose "All Files" from the dropdown, and type the full filename including .xml.
Uploading your sitemap to your server
Your sitemap file must live in the root directory of your website — the top-level folder where your homepage lives. This means it should be accessible at https://yoursite.com/sitemap.xml.
If you use a website builder like Wix, Squarespace, or WordPress.com, the platform usually generates a sitemap automatically and you do not need to upload anything manually. Check your site settings or SEO settings to confirm the sitemap exists.
If you have your own hosting account and manage files via FTP or a file manager, connect to your server and navigate to the root directory (often called public_html or www). Upload the sitemap.xml file there. If you use WordPress with your own hosting, install the Yoast SEO or Rank Math plugin — both generate and maintain your sitemap automatically.
After uploading, test that the file is accessible by typing https://yoursite.com/sitemap.xml into your browser. You should see the XML code displayed, not a 404 error.
Submitting your sitemap to search engines
Creating and uploading a sitemap is only half the work. You must also tell search engines where to find it. Start with Google Search Console — go to google.com/webmasters/tools, sign in with your Google account, and select your website. Click "Sitemaps" in the left menu, then paste your sitemap URL (https://yoursite.com/sitemap.xml) into the box and click "Submit".
Google will process the sitemap and show you how many pages it found, how many are indexed, and whether there are any errors. Check back in a few days to see the results. If pages are not being indexed, Google will tell you why — common reasons include noindex tags, robots.txt blocking, or pages that are too new.
Do the same for Bing Webmaster Tools at bing.com/webmasters. Sign in, select your site, go to Sitemaps, and submit your sitemap URL. Bing processes sitemaps more slowly than Google, but it is still worth submitting.
Keeping your sitemap up to date
If you add or remove pages infrequently, you can regenerate your sitemap manually every few months using the same tool you used to create it. Download the new version and upload it to your server, replacing the old file. Search engines will notice the change the next time they check.
If you add pages regularly, automate the process. Most content management systems have plugins or built-in features that update your sitemap automatically whenever you publish new content. WordPress users should use Yoast SEO or Rank Math, which handle this without any extra work. Shopify stores generate sitemaps automatically. Wix and Squarespace do the same.
You do not need to resubmit your sitemap to Google or Bing every time it changes — they check it periodically on their own. However, if you make major changes (like removing 50 pages), you can manually resubmit to speed up the process.
Troubleshooting common sitemap problems
If Google Search Console shows "Submitted URL marked 'noindex'" for pages in your sitemap, those pages have a noindex tag that tells search engines not to index them. Remove the noindex tag if you want the pages indexed, or remove them from your sitemap if you do not want them indexed.
If your sitemap file is not being found, double-check the filename (it must be exactly sitemap.xml) and the location (it must be in your root directory). Test the URL in your browser. If you see a 404 error, the file is not in the right place.
If you have a very large site with more than 50,000 pages, you need to split your sitemap into multiple files and create a sitemap index file that lists them all. Most sitemap generators handle this automatically, but if you are building manually, refer to the sitemaps.org protocol documentation.
Frequently Asked Questions
Do I need a sitemap if I use WordPress?
WordPress does not create a sitemap by default, but any SEO plugin like Yoast SEO, Rank Math, or All in One SEO will generate and maintain one automatically. Install one of these plugins and enable the sitemap feature in settings. You still need to submit the sitemap URL to Google Search Console and Bing Webmaster Tools.
What is the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is for search engines — they read the code and use it to crawl your site. An HTML sitemap is a regular webpage that lists links to your site's pages, meant for visitors. You only need an XML sitemap for SEO purposes. An HTML sitemap is optional and rarely used anymore.
How often should I update my sitemap?
If you add pages weekly or more often, use a plugin that updates automatically. If you add pages monthly or less frequently, regenerate your sitemap manually every month or two. Search engines check your sitemap regularly, so they will notice changes within days even if you do not resubmit.
Can a sitemap hurt my SEO if it includes pages I do not want indexed?
Yes. If your sitemap lists pages with noindex tags, search engines see the conflict and may ignore the sitemap. Remove those pages from your sitemap, or remove the noindex tag if you want them indexed. Keep your sitemap clean — only include pages you actually want search engines to find.
What if my website is behind a login or password?
Search engines cannot crawl pages that require a login, so do not include them in your sitemap. Only list pages that are publicly accessible. If you have a large site with both public and private sections, create a sitemap that covers only the public pages.