How to Submit a Sitemap to Google
Step-by-step guide to submitting your sitemap to Google via Search Console, the ping method, and robots.txt. Plus Bing submission, verification steps, and troubleshooting common errors.
You've created your sitemap. Now you need to tell Google about it. There are three ways to do this, and the best approach is to use all three -- they're complementary, not mutually exclusive.
Method 1: Google Search Console (Recommended)
This is the primary method. Google Search Console gives you direct submission, status tracking, and error reporting. If you're only going to do one thing, do this.
Prerequisites
You need a verified Google Search Console property for your domain. If you haven't set this up yet, go to search.google.com/search-console and add your site. Verification options include DNS record, HTML file upload, HTML meta tag, Google Analytics, and Google Tag Manager.
Submission Steps
Log into Google Search Console
Go to search.google.com/search-console and select your property. Make sure you're looking at the correct property -- if you have both http:// and https:// versions, or www and non-www, submit to the one that matches your sitemap URLs. Better yet, use a Domain property that covers all variations.
Navigate to the Sitemaps section
In the left sidebar, click "Sitemaps" under the "Indexing" section.
Enter your sitemap URL
In the "Add a new sitemap" field at the top of the page, type the path to your sitemap. If your sitemap is at https://yoursite.com/sitemap.xml, you only need to type sitemap.xml (the domain prefix is pre-filled).
If you use a sitemap index, submit the index URL. Google will discover and process all child sitemaps automatically.
Click Submit
Google will attempt to fetch your sitemap immediately. The status will show as "Pending" at first.
Check the results
After a few minutes (sometimes hours for large sitemaps), the status will update. You'll see:
- Success: The sitemap was fetched and processed. You'll see the number of discovered URLs.
- Has errors: The sitemap was fetched but contains issues. Click through to see specific errors.
- Couldn't fetch: Google couldn't access the sitemap URL. Check that the URL is correct, the file exists, and it's not blocked by robots.txt or requiring authentication.
You only need to submit once
After the initial submission, Google will periodically re-fetch your sitemap on its own schedule. You don't need to resubmit every time your sitemap updates. Google will notice the changes during its regular re-fetches.
What to Watch For After Submission
Once your sitemap is submitted, check back in a few days. In the Sitemaps report, you'll see:
- Discovered URLs: How many URLs Google found in the sitemap.
- Indexed URLs: How many of those URLs actually made it into Google's index (visible in the Coverage/Pages report).
If there's a large gap between discovered and indexed, don't panic immediately. Google doesn't index every URL it discovers. Pages might be excluded because they're duplicates, low quality, blocked by noindex, or simply not yet crawled. Check the Pages report (Indexing > Pages) for specific reasons.
Method 2: The Ping Method
You can notify Google about your sitemap by sending an HTTP request to their ping endpoint. This is useful for automated workflows -- for example, pinging Google after every deployment that updates your sitemap.
Send a GET request to:
https://www.google.com/ping?sitemap=https://yoursite.com/sitemap.xml
You can do this in a browser, with curl, or in code:
curl "https://www.google.com/ping?sitemap=https://yoursite.com/sitemap.xml"
The URL must be fully encoded. If your sitemap URL contains special characters, encode them (colons, slashes, etc. are fine -- they're standard URL characters).
Add the ping to your deployment pipeline
If you regenerate your sitemap during builds, add the ping as a post-deployment step. This tells Google to re-fetch the sitemap immediately rather than waiting for its next scheduled check.
# In your CI/CD pipeline, after deployment:
curl -s "https://www.google.com/ping?sitemap=https://yoursite.com/sitemap.xml"
Google will return a 200 response confirming they received the notification. This doesn't mean they'll crawl your sitemap immediately -- it just puts it in the queue.
Method 3: Declare in robots.txt
Adding your sitemap URL to your robots.txt file is the passive method. You're not actively notifying Google -- you're placing the information where Google will find it the next time it checks your robots.txt (which it does regularly).
Add this line to your robots.txt file (typically at the bottom):
Sitemap: https://yoursite.com/sitemap.xml
You can declare multiple sitemaps:
User-agent: *
Disallow: /admin/
Sitemap: https://yoursite.com/sitemap.xml
Sitemap: https://yoursite.com/sitemap-news.xml
Sitemap: https://yoursite.com/sitemap-images.xml
The Sitemap directive is not tied to any User-agent block. It applies globally to all crawlers, and it can appear anywhere in the file -- though convention puts it at the end.
Validate before you submit
Check your sitemap for errors before submitting it to Google. Catch broken URLs, encoding issues, and protocol violations.
Submitting to Bing
Google isn't the only search engine. Bing processes sitemaps too, and submission is similar.
Bing Webmaster Tools
Log into Bing Webmaster Tools
Go to bing.com/webmasters and sign in. If you haven't added your site, you can import it directly from Google Search Console -- Bing offers a one-click import.
Navigate to Sitemaps
In the left sidebar, click "Sitemaps."
Submit your sitemap
Enter the full URL of your sitemap and click Submit.
Bing also supports the ping method:
curl "https://www.bing.com/ping?sitemap=https://yoursite.com/sitemap.xml"
And Bing reads the Sitemap directive in robots.txt, so if you've done that step for Google, Bing is already covered.
Other Search Engines
Yandex has its own webmaster tools at webmaster.yandex.com with a similar submission process. Yahoo uses Bing's index, so submitting to Bing covers Yahoo automatically. Most other search engines read robots.txt, so the Sitemap directive covers them passively.
Verifying Your Submission Worked
After submitting, here's how to confirm everything is working:
Check Search Console status
Monitor the Pages report
Search for a specific page
site:yoursite.com/specific-page. If it shows up within a few days, the sitemap is working.Check server logs
Troubleshooting Common Errors
"Couldn't fetch"
This means Google tried to access your sitemap URL and failed. Common causes:
- Wrong URL: Double-check the URL. Typos happen. Make sure the protocol (http vs https) and path are correct.
- Blocked by robots.txt: If your robots.txt disallows access to your sitemap directory, Google can't fetch it. Ensure the sitemap file isn't in a disallowed path.
- Server error: If your server returned a 500 error when Google tried to fetch, it shows as "Couldn't fetch." Check your server logs.
- Authentication required: If the sitemap is behind authentication (staging site, password-protected directory), Google can't access it.
"Has errors"
Google fetched the sitemap but found problems in the content. Common issues:
- Invalid XML: Missing closing tags, incorrect nesting, or encoding errors. Validate your XML with any XML validator.
- URLs return errors: If many URLs in the sitemap return 404, 500, or redirect status codes, Google will report this.
- Namespace issues: Missing or incorrect
xmlnsdeclaration on the<urlset>element.
"Sitemap is an HTML page"
You submitted a URL that returns an HTML page instead of XML. This usually means:
- The URL is wrong and hits a regular web page
- Your server is returning a custom 404 page instead of a proper 404 status code
- A redirect is sending the sitemap URL to your homepage
URLs not getting indexed
Submitting a sitemap doesn't guarantee indexing. If pages from your sitemap aren't appearing in Google's index:
- Check for
noindexmeta tags or HTTP headers on those pages - Verify the pages return 200 status codes
- Ensure the content is unique and substantive
- Check that the pages aren't canonicalized to different URLs
- Be patient -- indexing can take days to weeks for new pages
| Method | Speed | Feedback | Automation |
|---|---|---|---|
| Google Search Console | Fast (queued immediately) | Full (status, errors, URL count) | Manual (one-time) |
| Ping endpoint | Fast (queued immediately) | None (just a 200 OK) | Easy to automate |
| robots.txt | Passive (next crawl) | None | Set and forget |
The Recommended Approach
Use all three methods:
- robots.txt -- Set it once and forget it. Every search engine will find your sitemap passively.
- Google Search Console -- Submit once for the detailed reporting and error feedback.
- Ping endpoint -- Automate it in your deployment pipeline for instant notification after updates.
This belt-and-suspenders approach ensures Google knows about your sitemap regardless of which discovery method it checks first.
Related Articles
Submit to Search Console. Declare in robots.txt. Ping on deploy. Then stop worrying about it.
Validate your XML sitemap
Check your sitemap for errors, broken URLs, and indexing issues. Free instant validation.