An XML sitemap is a list of public URLs that you want search engines to discover. It can help with discovery, but it does not guarantee crawling, indexing or rankings.
Start with the sitemap your site already has
If your site uses a CMS, check whether it already generates a sitemap. WordPress, Wix and other platforms can maintain one as pages are added or removed. Use that sitemap rather than creating a second file that will go stale.
A manual sitemap makes sense when you have a small site, a curated URL list, or a build process that produces the final URLs separately.
Choose the URLs
Include canonical, public pages that you want search engines to consider. Do not add:
- login pages or other private URLs;
- URLs that redirect somewhere else;
- duplicate versions of the same page;
- pages you deliberately exclude from search;
- broken or temporary URLs.
Use absolute URLs, and keep the hostname consistent. For example, decide whether the site uses https://example.com or https://www.example.com and do not mix both versions in one sitemap.
Write the XML
The basic sitemap format is small. Each page goes inside a <url> element, and its address goes inside <loc>:
<?xml version=1.0 encoding=UTF-8?>
<urlset xmlns=http://www.sitemaps.org/schemas/sitemap/0.9>
<url>
<loc>https://example.com/</loc>
</url>
<url>
<loc>https://example.com/about</loc>
</url>
</urlset>
Escape characters that have a special meaning in XML. For example, an ampersand in a query string becomes &:
<loc>https://example.com/search?a=1&b=2</loc>
You do not need to add priority or changefreq. Google ignores those fields. Add lastmod only when the date reflects a real, significant update to that URL. Invented dates make the file less useful, so it is better to leave the field out.
Check the limits
A sitemap can contain up to 50,000 URLs or 50 MB when uncompressed. Larger sites can split the URLs across several sitemap files and reference them from a sitemap index.
For a small, already curated list, a browser-local converter is enough. The free XML sitemap generator removes duplicate URLs and fragments, escapes XML characters and downloads sitemap.xml. It does not crawl the site or upload the pasted list.
Publish and submit it
Upload the file to the public location you choose, commonly:
https://example.com/sitemap.xml
Then check the URL in a browser or with an HTTP client. It should return the XML file, not an HTML error page or a login screen.
You can also declare the location in robots.txt:
Sitemap: https://example.com/sitemap.xml
For a site you manage, submit the sitemap URL in Google Search Console. Keep the sitemap current when public URLs are added, removed or replaced.
What a sitemap cannot tell you
A successful upload does not prove that Google has crawled or indexed every listed page. It also does not improve a weak page, override a canonical decision, or guarantee rankings. Review indexing evidence separately in Search Console and check the pages themselves for useful content, access, canonical URLs and appropriate robots directives.
The useful test is simple: include the right public URLs, publish valid XML at a stable address, and then verify what search engines actually did with it.
Top comments (0)