XML Sitemap: What It Is, How to Create One and Submit It to Google
Learn what an XML sitemap does, how to find or create one for WordPress and other websites, and how to submit it through Google Search Console.
An XML sitemap is a file that helps search engines discover important pages, posts and other content on your website. It is especially useful when a website is new, has many pages, or contains pages that are not easy to discover through internal links.
If you want search engines to understand the structure of your website, an XML sitemap is one of the basic technical SEO elements worth checking. In this guide, we explain what an XML sitemap is, how it works, how to create one and how to submit it to Google.
How an XML sitemap helps search engines
1. What Is an XML Sitemap?
An XML sitemap is a machine-readable file that lists URLs on a website. It gives search engines information about pages that a website owner considers important and wants crawlers to discover.
Unlike a normal HTML sitemap, which is usually designed for human visitors, an XML sitemap uses a structured format that search engines can process.
A sitemap can include information such as the page URL and, in some cases, details about when content was last modified. Search engines may use this information as a discovery or scheduling hint.
2. Why Is an XML Sitemap Important for SEO?
An XML sitemap can help search engines discover URLs, particularly when a website has a large number of pages or a complex structure.
Helps URL discovery
Provides search engines with a list of URLs you want them to know about.
Useful for new websites
Can help expose new pages when a site has few external links.
Supports large websites
Helps communicate URLs on websites with many pages or content types.
3. What Types of Websites Need an XML Sitemap?
Most websites can benefit from having a sitemap, although it is especially useful for:
- New websites with few links pointing to them.
- Large websites with many pages.
- News, publishing and blog websites that regularly add content.
- E-commerce websites with product and category pages.
- Websites with pages that are not easily discovered through navigation.
- Websites that use multiple content types, such as articles, products and videos.
Small websites with clear navigation and strong internal linking may be discoverable without a sitemap, but having one is still a useful way to communicate important URLs.
4. How to Find Your Website's XML Sitemap
Many website platforms and SEO plugins create an XML sitemap automatically. Try opening common sitemap addresses using your own domain:
https://example.com/wp-sitemap.xml
https://example.com/sitemap_index.xml
https://example.com/sitemap.xml
These are common examples, not guaranteed addresses. Your actual sitemap URL depends on the platform, settings and plugins installed on your website.
If one address returns a 404 error, check your SEO plugin settings or website documentation. Do not assume that a missing address means the website has no sitemap at all.
5. How to Create an XML Sitemap in WordPress
Recent versions of WordPress include a basic XML sitemap feature. The default sitemap index is commonly available at:
https://example.com/wp-sitemap.xml
WordPress SEO plugins may provide their own sitemap generation and configuration. For example, a plugin may create a sitemap index at a different URL.
Using the built-in WordPress sitemap
- Open your website in a browser.
- Add
/wp-sitemap.xmlafter your domain. - Check whether the sitemap index loads.
- Open the listed sitemap files to confirm they contain the expected URLs.
Using an SEO plugin
- Open your SEO plugin's settings.
- Find its sitemap or XML sitemap section.
- Enable sitemap generation if it is disabled.
- Review which content types and taxonomies are included.
- Open the sitemap URL shown by the plugin.
6. What Does an XML Sitemap Look Like?
An XML sitemap contains structured URL entries. A simplified example looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/about/</loc>
<lastmod>2026-10-15</lastmod>
</url>
<url>
<loc>https://example.com/contact/</loc>
</url>
</urlset>
The loc element contains the page URL. The optional lastmod element can indicate when the page was last significantly modified. Only provide accurate modification dates; do not update them automatically just to make every URL appear fresh.
7. XML Sitemap Best Practices
Use canonical URLs
Include the preferred version of each page, not multiple URL variations.
Use accessible URLs
List pages that search engines can crawl and that you want considered for indexing.
Keep it updated
Make sure new and removed content is reflected in the sitemap.
- Use absolute URLs, including the full HTTPS address.
- Include preferred canonical URLs.
- Do not include URLs that redirect to another page.
- Avoid listing pages blocked by robots.txt or marked noindex.
- Do not include private, login-only or irrelevant URLs.
- Use accurate last-modified information where supplied.
- Make sure the sitemap returns a successful response and valid XML.
Google supports up to 50,000 URLs or 50 MB uncompressed per sitemap file. Larger sites can use multiple sitemap files and a sitemap index.
8. How to Submit an XML Sitemap to Google
After confirming that your sitemap works, you can submit it through Google Search Console.
- Open Google Search Console.
- Select the correct website property.
- Choose Sitemaps from the indexing area.
- Enter the sitemap path or full sitemap URL.
- Submit it.
- Return later to review the submission status and any reported errors.
Sitemap submission process
9. Common XML Sitemap Errors and How to Fix Them
| Error or symptom | What to check |
|---|---|
| Sitemap could not be fetched | Check that the URL loads publicly and returns a successful response. |
| 404 Not Found | Confirm the correct sitemap path and plugin settings. |
| Invalid XML | Check formatting, XML syntax and unexpected output before the XML declaration. |
| URLs are blocked | Review robots.txt and access restrictions. |
| URLs are marked noindex | Review page-level indexing settings and sitemap inclusion rules. |
| Redirecting URLs | Update the sitemap to use the final canonical destination. |
| Wrong domain or protocol | Use the preferred HTTPS and hostname version of each URL. |
After correcting an error, check the sitemap directly and review the status in Search Console. Some reports take time to update.
10. XML Sitemap vs Robots.txt: What Is the Difference?
These files serve different purposes and should not be confused.
| XML Sitemap | Robots.txt |
|---|---|
| Lists URLs that you want search engines to discover. | Provides crawler instructions about URL paths they may request. |
| Helps communicate website content structure. | Helps manage crawling access and reduce unnecessary crawling. |
| Does not guarantee indexing. | Does not reliably remove a URL from the search index. |
For many websites, both files are useful. The sitemap helps search engines discover preferred URLs, while robots.txt provides crawling instructions.
11. XML Sitemap Checklist
12. Check Your Website's Sitemap and Technical SEO
A working sitemap is one part of a healthy technical SEO setup. Your website should also be accessible, use correct canonical URLs and avoid accidental indexing restrictions.
Website Doctor's free homepage inspection includes an XML sitemap check alongside other technical checks such as website availability, page title, meta description, canonical URL and indexing directive.
Check Your Website's Technical Health
Run a free Website Doctor scan to review important technical elements of your homepage.
Run a Free Website ScanFrequently Asked Questions
What is an XML sitemap?
An XML sitemap is a structured file that lists website URLs to help search engines discover important pages and other content.
Does every website need an XML sitemap?
Not every small website needs one to be discovered, but a sitemap is useful for many websites and is especially helpful for large, new or frequently updated sites.
Where is the sitemap in WordPress?
The built-in WordPress sitemap is commonly available at /wp-sitemap.xml. SEO plugins may generate a sitemap at a different address.
Does submitting a sitemap guarantee Google indexing?
No. A sitemap helps Google discover URLs, but Google decides which pages to crawl and index.
How often should I update my sitemap?
Your sitemap should reflect meaningful changes to the site's URLs and content. Many WordPress sitemap systems update automatically when content is published or changed.
Can I have more than one sitemap?
Yes. Large websites can use multiple sitemap files and a sitemap index that lists them.
Should noindex pages be in my sitemap?
Generally, no. A sitemap should focus on preferred URLs that you want search engines to consider for indexing.
What is the difference between an XML sitemap and an HTML sitemap?
An XML sitemap is primarily designed for search engines. An HTML sitemap is a page designed to help human visitors navigate website content.
Final Thoughts
An XML sitemap is a useful part of technical SEO because it helps search engines discover important URLs on your website. Make sure it loads correctly, contains preferred canonical URLs, stays updated and is submitted through Google Search Console.
Remember that a sitemap supports discovery; it does not guarantee crawling, indexing or search rankings. Combine it with accessible pages, sensible internal links and useful website content.