SEO title: How to Create an XML Sitemap and Submit It to Google
Focus keyword: how to create an XML sitemap
Secondary keywords: XML sitemap for SEO, Google sitemap submission, sitemap generator, website sitemap
URL slug: how-to-create-xml-sitemap
Meta description: Learn how to create an XML sitemap, check its URLs, and submit it through Google Search Console to help Google discover your pages.
Search intent: Informational
Suggested tags: XML Sitemap, Technical SEO, Google Search Console, Website Indexing
Introduction
Search engines need to discover webpages before they can consider indexing them.
Internal links and external links help search engines find pages, but larger or more complex websites may also benefit from an XML sitemap.
An XML sitemap provides information about important URLs on your website. It can help Google discover pages, although submitting a sitemap does not guarantee that every listed page will be crawled or indexed.
In this guide, you will learn how to create and submit an XML sitemap.
What Is an XML Sitemap?
An XML sitemap is a file that lists URLs you want search engines to discover.
It may include information such as:
- Page URLs.
- Last modification dates.
- References to image or video content.
- Links to other sitemap files.
A typical sitemap may be available at:
https://example.com/sitemap.xml
Some website platforms use a different sitemap path.
1. Check Whether Your Website Already Has a Sitemap
Before creating a new sitemap, check whether your website already generates one.
Try opening:
https://yourdomain.com/sitemap.xml
You can also check your website platform’s SEO settings.
Many content management systems and SEO plugins generate XML sitemaps automatically.
Avoid creating multiple competing sitemap systems without a clear reason.
2. Create a Sitemap Using Your Website Platform
The process depends on the platform you use.
For example:
- WordPress may generate sitemaps automatically or through an SEO plugin.
- Ecommerce platforms may provide built-in sitemap functionality.
- Custom websites may require a sitemap generator or developer implementation.
If your platform already creates a sitemap, use that feature rather than maintaining a separate file manually.
3. Include Important URLs
Your sitemap should list the canonical versions of pages that you want search engines to discover.
Common examples include:
- Main website pages.
- Useful blog articles.
- Important product pages.
- Relevant category pages.
Avoid including unnecessary URLs such as:
- Duplicate pages.
- Redirecting URLs.
- Error pages.
- Pages you intentionally do not want indexed.
- Unimportant filtered or parameter-based URLs.
A sitemap should reflect the preferred version of your content.
4. Check Your Sitemap Format
An XML sitemap should follow the appropriate sitemap protocol.
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/</loc>
<lastmod>2026-10-15</lastmod>
</url>
<url>
<loc>https://example.com/seo-guide/</loc>
<lastmod>2026-10-20</lastmod>
</url>
</urlset>
The dates above are examples. Use accurate last-modified dates when your sitemap includes them.
Do not update every page’s last-modified date automatically if the content has not actually changed.
5. Add Your Sitemap to Robots.txt
You can include a sitemap reference in your website’s robots.txt file.
For example:
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xml
This is an example only. Your robots.txt rules should reflect your website’s actual crawling requirements.
6. Submit Your Sitemap to Google Search Console
Follow these steps:
- Sign in to Google Search Console.
- Select the correct website property.
- Open the Sitemaps section.
- Enter the sitemap URL.
- Submit the sitemap.
- Check the reported status.
If Google reports an error, inspect the sitemap URL and correct the problem.
7. Monitor Sitemap Status
After submission, check the sitemap report periodically.
Look for:
- Sitemap fetch errors.
- Invalid XML.
- Unexpected URLs.
- Redirecting URLs.
- Pages that should not be listed.
Remember that a successful sitemap submission does not mean every page will be indexed.
8. Update Your Sitemap When Your Website Changes
Your sitemap should reflect important changes to your website.
When you publish new pages, remove obsolete URLs, or change canonical URLs, make sure your sitemap remains accurate.
Most modern platforms update their sitemaps automatically.
Common XML Sitemap Mistakes to Avoid
- Listing pages that redirect.
- Including duplicate URLs.
- Including pages blocked from crawling.
- Listing non-canonical versions.
- Using incorrect XML formatting.
- Forgetting to submit the sitemap.
- Assuming submission guarantees indexing.
- Creating inaccurate last-modified dates.
Conclusion
An XML sitemap helps search engines discover important website URLs. Generate a sitemap using your website platform, include preferred canonical pages, check for errors, and submit it through Google Search Console.
Call to action: Open your website’s sitemap and verify that it contains your important, indexable pages.