How to Submit an XML Sitemap to Google Search Console

An XML sitemap is a file that lists the important pages on your website, helping search engines like Google discover, crawl, and index your content more efficiently. While Google can find most pages through normal crawling, submitting a sitemap ensures your most valuable pages get indexed faster and signals which URLs you consider canonical.

This guide walks through the three primary methods for submitting your sitemap to Google, along with best practices to maximize your sitemap's effectiveness.

Method 1: Submit via Google Search Console (Recommended)

Google Search Console is the most reliable and feature-rich method for sitemap submission. It provides immediate feedback on errors, shows indexing status over time, and lets you monitor how many URLs Google has discovered versus actually indexed.

To submit your sitemap, log into Google Search Console at search.google.com/search-console using the Google account that has access to your verified property. Select the property you want to manage from the property selector dropdown in the top-left corner. In the left sidebar, navigate to Indexing, then click on Sitemaps. In the "Add a new sitemap" field, enter your sitemap URL—this is typically sitemap.xml or sitemap_index.xml, though it can be any valid path. Click Submit and wait for Google to process your sitemap.

After submission, Search Console displays the sitemap status, the date it was last read, and the number of URLs discovered. Check back after a few days to see how many URLs have been indexed compared to how many were submitted. A significant gap between discovered and indexed URLs may indicate quality issues, crawl restrictions, or duplicate content problems worth investigating.

Method 2: Declare Your Sitemap in robots.txt

Adding a sitemap directive to your robots.txt file is a passive but effective method that works for all search engines simultaneously. When crawlers access your robots.txt file (which they do regularly), they automatically discover your sitemap location.

Add this line to your robots.txt file, replacing the example domain with your own:

Sitemap: https://www.example.com/sitemap.xml

The sitemap directive can appear anywhere in your robots.txt file and is not bound by any User-agent directives. You can include multiple sitemap declarations if you have more than one sitemap. This method is particularly valuable because it requires no ongoing maintenance—once set, it persists until you change it, and search engines will find updated sitemaps automatically.

Method 3: Use the Ping URL (Programmatic Submission)

Google provides a ping endpoint that allows you to notify them programmatically when your sitemap has been updated. This is useful for sites with frequently changing content or automated publishing workflows.

To ping Google, send a GET request to the following URL, replacing the sitemap parameter with your actual sitemap URL:

https://www.google.com/ping?sitemap=https://www.example.com/sitemap.xml

You can trigger this ping via a browser, curl command, or integrate it into your CMS or deployment pipeline. Note that Google does not guarantee immediate crawling after a ping—it simply notifies them that your sitemap has changed. For most sites, relying on Search Console submission and robots.txt declaration is sufficient; the ping method adds value primarily for high-frequency publishers.

XML Sitemap Best Practices

Following sitemap best practices ensures Google can efficiently process your URLs and helps you avoid common indexing issues.

Size and Format Limits

Individual sitemaps are limited to 50MB (uncompressed) and 50,000 URLs. For larger sites, use a sitemap index file that references multiple individual sitemaps. Most e-commerce platforms and CMS systems handle this automatically, generating a sitemap_index.xml that points to category, product, and page sitemaps.

Include Only Indexable, Canonical URLs

Your sitemap should contain only URLs you want indexed. Exclude pages with noindex tags, URLs that redirect, pages blocked by robots.txt, paginated pages beyond page one (in most cases), and non-canonical URL variations. Including problematic URLs wastes crawl budget and can confuse search engines about which pages matter.

Use the lastmod Tag Accurately

The lastmod (last modified) element tells search engines when a page was last meaningfully updated. Google uses this as a crawl signal, so only update this value when content actually changes—not on every page load or minor template update. Inaccurate lastmod values train Google to ignore this signal from your site entirely.

Compression Is Acceptable

Google accepts gzip-compressed sitemaps with the .gz extension. If your sitemap file is large, compressing it reduces bandwidth and speeds up crawling. Simply submit sitemap.xml.gz instead of the uncompressed version.

Use Both Submission Methods

For maximum reliability, submit your sitemap through Search Console and declare it in robots.txt. This belt-and-suspenders approach ensures Google discovers your sitemap even if one method fails, and it makes your sitemap available to other search engines that check robots.txt but do not use Search Console.

Platform-Specific Notes

Most modern CMS and e-commerce platforms automatically generate and maintain XML sitemaps. Here is where to find them on common platforms:

Shopify: Sitemaps are generated automatically at /sitemap.xml. Shopify creates a sitemap index pointing to product, collection, page, and blog sitemaps.

WordPress: Core WordPress (5.5+) generates a sitemap at /wp-sitemap.xml. SEO plugins like Yoast or Rank Math create more comprehensive sitemaps, typically at /sitemap_index.xml.

BigCommerce: Found at /xmlsitemap.php, automatically updated when products or pages change.

Wix: Automatically generated at /sitemap.xml with no configuration required.

Before submitting, verify your sitemap is accessible by visiting the URL directly in your browser. The file should display valid XML with your site's URLs. If you see an error page or malformed content, troubleshoot your sitemap generation before submission.

Conclusion

Submitting an XML sitemap to Google is straightforward and takes just a few minutes, but the indexing benefits are significant—especially for new sites, large catalogs, or pages with limited internal linking. Use Google Search Console for the richest feedback, add the sitemap declaration to robots.txt for redundancy, and follow the best practices outlined above to ensure Google can make the most of your sitemap data.

Once submitted, monitor your sitemap's performance in Search Console periodically. A healthy sitemap shows a close match between discovered and indexed URLs. If you notice a growing gap, investigate which URLs are being excluded and why—the Coverage report in Search Console provides detailed diagnostic information to guide your next steps.