How to Create and Submit an XML Sitemap, and What Actually Gets Pages Indexed
An XML sitemap is a file that lists the URLs you want search engines to know about, in a format they can read automatically. Creating one and submitting it in Google Search Console helps discovery, but it is important to be honest about what it does. A sitemap tells crawlers your pages exist, it does not tell them your pages are worth indexing. Discovery is the easy part. Indexing and ranking depend on content quality, uniqueness and crawlability.
This guide covers how to generate a clean sitemap, where to host it, the two lines to add to robots.txt, how to submit it in Google and Bing, and the rules that quietly cause sitemaps to be ignored. You can build the file with the free sitemap generator and sanity-check the destination with the index checker.
What an XML sitemap does, and what it does not
A sitemap is a submission of candidates. It speeds up discovery of pages that are new, isolated, or generated dynamically, pages a crawler might not reach by simply following links. On a small, well-linked site, Google often finds everything without a sitemap at all. The file mainly helps large, new, or poorly interlinked sites.
What a sitemap never does. It does not force indexing, it does not raise rankings, and it does not override a noindex tag or a robots.txt Disallow. If a URL is blocked or marked noindex, listing it in a sitemap is at best ignored and at worst a signal that your crawl data is untidy. Only list URLs you actually want indexed. Canonical, indexable, status-200 pages.
Generate the file
Open the sitemap generator, paste the list of your absolute page URLs, one per line, full https addresses, and export the XML. The output is a standards-compliant <urlset> with a <loc> per URL and optional <lastmod> dates.
Keep it clean. No redirect chains, no URLs blocked in robots.txt, no noindex pages, and no trailing query-string duplicates. Each <loc> must be a fully qualified, URL-encoded address, and every page must belong to the same host and protocol as the sitemap itself, a sitemap at https://example.com/ cannot list http:// or third-party URLs.
Host it and reference it in robots.txt
Upload the file to your web root so it resolves at a stable URL such as https://example.com/sitemap.xml. Then add one line to robots.txt so crawlers that find the file also find the map.
Sitemap: https://example.com/sitemap.xml
That Sitemap: line is the only robots.txt directive that is allowed to point at another host, and it must be a full absolute URL. You can list more than one sitemap this way, for example separate maps for posts and images. Search engines read all of them.
Submit in Google Search Console and Bing
In Google Search Console, open the Sitemaps report under the Indexing menu, paste the sitemap URL, and Submit. The report then shows whether Google could read the file and how many of your listed URLs it has discovered and indexed. In Bing Webmaster Tools the flow is the same. Add the sitemap URL under Sitemaps. Bing can also pick the map up automatically from the robots.txt line.
Submitting to Search Console and listing the map in robots.txt are complementary, not either-or. The robots.txt line lets any crawler discover the map on its own, while the Search Console submission gives you a report and a direct signal.
The size and format limits that trip people up
Search engines cap what a single sitemap file may contain. Stay inside these numbers or the file is rejected outright.
| Rule | Limit | If you exceed it |
|---|---|---|
| URLs per sitemap file | 50,000 | Split into child sitemaps under a sitemap index. |
| Uncompressed file size | 50 MB | Again, split. Gzip the served file where possible. |
| Encoding | UTF-8 | Non-UTF-8 or unescaped &/spaces cause parse errors. |
| Scope | Same host and protocol | A map cannot list URLs on another domain or scheme. |
Larger sites use a sitemap index, a short file whose <sitemapindex> entries each point to a child sitemap of 50,000 URLs or fewer. WordPress SEO plugins and most static generators create the index automatically. You submit the index URL, not every child.
How to tell if it actually helped
Do not judge a sitemap by whether it was accepted, judge it by outcomes. In Search Console compare Pages reported as indexed against the URLs you submitted, and watch the Coverage/Pages reports for why others were excluded, Crawled, currently not indexed, Duplicate without canonical, Blocked by robots, and so on. If your map is clean but pages still are not indexed, the problem is quality, duplication or internal linking, not the sitemap.
Before blaming the file, verify individual addresses are actually indexable. Run them through the index checker, and use the broken link checker to make sure the map does not point at dead or redirected pages.
Frequently Asked Questions
Do I still need an XML sitemap?
On a small site with good internal links it is not strictly required, crawlers can find everything by following links. It still helps because it is cheap insurance and, more usefully, it gives you the Search Console report that shows how many submitted URLs were actually indexed.
Will submitting a sitemap make my pages rank?
No. A sitemap affects discovery, not position. Ranking comes from relevance, content quality, uniqueness and links. A sitemap can even be harmful if it lists thin or duplicate pages, because it tells Google exactly which low-value URLs you want crawled.
How many URLs can one sitemap hold?
Up to 50,000 URLs and 50 MB uncompressed, for a single host and protocol. Above that, create a sitemap index that points to multiple child sitemaps, each within the limits.
Should I list every page or only important ones?
List only pages you genuinely want indexed. Canonical, status-200, not noindexed, not blocked. Leaving out archive junk, thank-you pages and duplicate parameter URLs keeps the map a signal of quality rather than a list of everything.
Where does the sitemap go and how do I point to it?
Host it at a stable URL such as https://example.com/sitemap.xml, then add a full Sitemap. Line to robots.txt and also submit the same URL in Search Console. Both paths work together.
My sitemap says accepted but pages are not indexed, why?
Because acceptance only means the file parsed. Pages may be excluded for being duplicates, blocked, noindexed, low quality or simply not worth crawling. Read the Coverage or Pages report for the specific reason instead of assuming the sitemap is broken.