In short
- A sitemap makes discovery easier; it doesn't directly affect rankings and doesn't guarantee that the listed URLs will be indexed.
- The sitemap should contain only canonical URLs that return 200, aren't noindex and aren't blocked by robots.txt.
- Google's limit is 50,000 URLs or 50 MB uncompressed per file; larger sites use a sitemap index.
- Google ignores the
changefreqandpriorityfields and uses thelastmodvalue only if it's consistent and accurate. - Declare the sitemap with the
Sitemap:line in robots.txt and through Search Console; Google's old ping endpoint no longer works.
What is a sitemap for, and does every site need one?
Google mostly finds pages by following links. A sitemap adds a second path to that discovery: it states directly which URLs are important and when they changed. According to Google's documentation, a sitemap is especially useful for:
- Sites with many pages, so that new or updated pages aren't overlooked.
- New sites: because they don't yet have many links from other sites, bots may not be able to find their pages through links.
- Sites with weak internal linking, deep archives or sections that aren't connected to each other.
- Sites with a lot of video, image or news content; extensions carry extra information about this content.
Google notes that well-linked sites of about 500 pages or fewer may not need a sitemap. Even so, a sitemap does no harm, and most content management systems generate one automatically. Also be clear about what a sitemap doesn't do: it doesn't directly boost rankings, it doesn't guarantee that every listed URL will be crawled or indexed, and it doesn't make up for a poorly built site structure.
Sitemap format: urlset, loc and lastmod
The standard format is defined by the sitemaps.org protocol; Google, Bing and other major search engines read it. The simplest valid sitemap looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.ornek-site.com/</loc>
<lastmod>2026-11-02</lastmod>
</url>
<url>
<loc>https://www.ornek-site.com/hizmetler/web-tasarim</loc>
<lastmod>2026-10-18T09:30:00+03:00</lastmod>
</url>
</urlset>
<urlset>is the root element and carries the namespace. The namespace must be exactlyhttp://www.sitemaps.org/schemas/sitemap/0.9; writing it withhttpsis a common mistake.- Each page is a
<url>element. The<loc>inside it is required and must be a full URL including the protocol and domain name. Under the protocol, the URL must be shorter than 2,048 characters. <lastmod>is optional and gives the date of the page's last significant change in W3C format: either just the date (2026-11-02) or a full timestamp with a time zone (2026-10-18T09:30:00+03:00).<changefreq>and<priority>exist in the protocol, but Google ignores both fields. They do no harm; they just add maintenance work.
The file must be UTF-8 encoded. In XML, the & character is written as &; leaving a URL like ?renk=mavi&beden=m unescaped breaks the whole file. Write URLs with non-ASCII characters in percent-encoding too: /kategori/%C3%A7anta instead of /kategori/çanta.
Keeping lastmod accurate
Google uses lastmod values only on sites where it sees that they are consistently and verifiably accurate. According to its documentation, a change to the main content, the structured data or the links on the page counts as significant; a change to the copyright year in the footer doesn't. Common mistakes:
- Today's date appearing on every URL because the sitemap is regenerated on every request.
- Updating the date for minor changes such as comments, counters or the sidebar.
- Future dates, or values with a time but no time zone (
2026-10-18T09:30:00).
Take the date from the content's actual update time. The last-updated field in your content management system or, on static sites, the file's last commit date are good sources.
Text, RSS and Atom sitemaps
Besides XML, Google accepts two other formats. A text sitemap has just one full URL per line; it's easy to make but can't carry lastmod, image or hreflang information. RSS 2.0 and Atom 1.0 feeds can also be submitted as sitemaps. Because feeds usually list only recent content, they help new posts get found quickly but don't replace a complete XML sitemap.
Google's limits and the sitemap index
According to Google's documentation, a sitemap file can contain at most 50,000 URLs and can't exceed 50 MB uncompressed. You can serve the file compressed with gzip (sitemap.xml.gz); the limit still applies to the uncompressed size. Sites that exceed the limit split their URLs across several sitemaps and list them all in a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.ornek-site.com/sitemap-urunler-1.xml.gz</loc>
<lastmod>2026-11-05</lastmod>
</sitemap>
<sitemap>
<loc>https://www.ornek-site.com/sitemap-kategoriler.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.ornek-site.com/sitemap-blog.xml</loc>
</sitemap>
</sitemapindex>
- An index can list at most 50,000 sitemaps, and is itself subject to the 50 MB limit.
- An index must not list another index; Google doesn't support nested indexes.
- The
<lastmod>in the index shows when the listed sitemap itself changed. - In Search Console you can submit up to 500 index files per site.
When splitting the sitemap, separating by content type (products, categories, posts) helps not only with the limit but also with diagnosis. Because Search Console shows each sitemap separately, you can see right away in which section non-indexed URLs are piling up.
Location matters too. Under the protocol, a sitemap covers only URLs in its own folder and its subfolders: a /blog/sitemap.xml file can't list /urunler/ URLs. Publishing the sitemap at the root is the safest option. The URLs in the sitemap must be on the same host as the sitemap; to list URLs on another domain, you have to declare the sitemap in that domain's robots.txt or verify both sites in Search Console.
Which URLs belong in the sitemap?
A sitemap is your way of telling Google "these are the pages I want to see in the index". Every URL in it should meet these conditions:
- It returns 200. URLs that return 404, 410 or 5xx make the sitemap unreliable.
- It doesn't redirect. List the final destination instead of the redirecting URL; after site migrations, old URLs often linger in the sitemap.
- It's canonical. The page's canonical tag should point to itself. Don't list copies with parameters, session IDs or sorting variables.
- It's indexable.
noindexpages don't belong in the sitemap; Search Console reports them as submitted URLs marked noindex. - It's crawlable. A URL blocked by robots.txt creates a contradiction in the sitemap, because Googlebot can't crawl it.
- It's in your preferred version. URLs should use the site's canonical protocol and host: if the site opens with
https://www., the sitemap shouldn't containhttp://or non-www URLs.
Google also uses a URL listed in the sitemap as a weak signal when choosing the canonical URL, so it matters that the sitemap and your canonical tags point to the same URL. Examples of pages that don't belong in the sitemap: cart and account pages, internal search results, thank-you pages, thin tag archives and test pages.
See your sitemap's format, its URLs and the status of 20 random pages in a single check.
Sitemap validatorMultilingual sites: hreflang links in the sitemap
You can declare a page's language or country versions in the sitemap instead of with link tags in the HTML. For Google, the three methods (HTML, HTTP header and sitemap) are equivalent; on sites with many pages, using the sitemap keeps the HTML lighter. Each <url> element lists all versions, including itself:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://www.ornek-site.com/fiyatlar</loc>
<xhtml:link rel="alternate" hreflang="tr" href="https://www.ornek-site.com/fiyatlar"/>
<xhtml:link rel="alternate" hreflang="en" href="https://www.ornek-site.com/en/pricing"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://www.ornek-site.com/fiyatlar"/>
</url>
<url>
<loc>https://www.ornek-site.com/en/pricing</loc>
<xhtml:link rel="alternate" hreflang="tr" href="https://www.ornek-site.com/fiyatlar"/>
<xhtml:link rel="alternate" hreflang="en" href="https://www.ornek-site.com/en/pricing"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://www.ornek-site.com/fiyatlar"/>
</url>
</urlset>
- Each language version must appear in the sitemap with its own
<url>element and carry the same set of links. According to Google, if two pages don't point to each other, the links are ignored. - The
hreflangvalue is an ISO 639-1 language code, optionally combined with an ISO 3166-1 country code:tr,en,en-GB,de-AT. Codes such asen-UKare invalid. x-defaultis the page shown to users whose language doesn't match any version; on most sites it's the language selector or the main language version.- If you forget the
xmlns:xhtmldeclaration on the root element, the file becomes invalid in terms of namespaces and parsers may reject it.
You can put all languages in a single sitemap or list a separate sitemap per language in an index. For detailed rules, see the hreflang guide; to check the reciprocal links of a single page, use the Hreflang checker.
Image, video and news sitemaps
Google adds three extensions to the standard format. Each is declared with its own namespace on the root element and can be used inside a regular sitemap or in a separate file.
- Image: declared with
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1". Each<url>can contain up to 1,000<image:image>elements, each carrying only<image:loc>; in 2022 Google deprecated thecaption,title,geo_locationandlicensetags. It's useful for images Google might not otherwise find, such as those loaded with JavaScript. - Video: declared with
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1". Each video requiresvideo:thumbnail_loc,video:title,video:descriptionand eithervideo:content_locorvideo:player_loc. - News: declared with
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9". It lists only articles published in the last two days, and a file can contain up to 1,000<news:news>elements; the publication name, language, publication date and title are required. Add new articles to the same sitemap; don't create a new sitemap with every update.
An entry with the image extension looks like this; the image URL can be on a CDN:
<url>
<loc>https://www.magaza-ornek.com/urun/seramik-kupa</loc>
<image:image>
<image:loc>https://cdn.magaza-ornek.com/gorseller/seramik-kupa-1.jpg</image:loc>
</image:image>
</url>
How do you submit a sitemap?
There are two lasting ways to tell search engines about your sitemap; use both:
- robots.txt: add the line
Sitemap: https://www.ornek-site.com/sitemap.xmlto the file. The line requires a full URL, isn't tied to any bot group and can be repeated. This is how Bing and other search engines find the sitemap. You can confirm the line is written correctly in the robots.txt tester. - Search Console: enter the sitemap's URL in the Sitemaps report and submit it. If you use an index file, submitting just the index is enough. The report shows when Google last read the sitemap, whether it could read it and how many URLs it found.
For Bing, you can take the same step in Bing Webmaster Tools and use IndexNow for frequently changing content; IndexNow is supported by Bing and Yandex, not by Google. Google retired the method of notifying it of sitemaps through a ping URL in 2023; old plugins and scripts that send this request no longer do anything.
After submitting, check two places: the status and the number of discovered URLs in the Sitemaps report, and the Page indexing report. If you use the filter at the top of the second report to select only the URLs you submitted in your sitemap, you'll see which of the pages you want indexed have been left out, and why.
Sitemaps in WordPress, Shopify and other systems
WordPress
Since version 5.5, WordPress has generated a built-in sitemap index at /wp-sitemap.xml. Posts, pages, category and tag archives and author pages are split into separate sub-sitemaps, each holding up to 2,000 URLs. If the search engine visibility box under Settings › Reading is checked, the built-in sitemap is turned off.
If you use an SEO plugin, it usually turns off the built-in sitemap and generates its own (often /sitemap_index.xml). Two sitemaps shouldn't be live at once; enter whichever is actually active in Search Console and robots.txt. If you don't want author pages in the built-in sitemap, add this to your child theme's functions.php file:
add_filter( 'wp_sitemaps_add_provider', function ( $provider, $name ) {
return ( 'users' === $name ) ? false : $provider;
}, 10, 2 );
Shopify
Shopify automatically generates and maintains an index at /sitemap.xml, split into sub-sitemaps for products, collections, pages and blog posts; you can't edit the file directly. To remove a page from the sitemap, use Shopify's seo.hidden metafield, which also adds noindex to the page.
Static sites and custom software
Hugo generates a sitemap.xml by default; in Jekyll the jekyll-sitemap plugin, and in Next.js an app/sitemap.ts file, do the same job. In your own software, generate the sitemap from the database, using only published content that's open to indexing. Use the content's update time for lastmod; on large sites, split the files by content type and cache them, and refresh the relevant file when new content is published.
Check that the URLs in your sitemap are open to bots and that the Sitemap line is written correctly.
robots.txt testerCheck your sitemap step by step
- Find the sitemap. Just enter your domain in the Sitemap validator. The tool first looks at the
Sitemap:lines in robots.txt and, if there are none, at/sitemap.xml,/sitemap_index.xmland/wp-sitemap.xml. If no sitemap is found or it isn't declared in robots.txt, that's the first finding you'll see. - Fix the format. If it's an index, the tool goes down into the sub-sitemaps, opens compressed files and shows XML errors with their line numbers: an unclosed tag, an unescaped
&, a missing or wrong namespace. Google can read a sitemap with XML errors only partly or not at all, so start with these. - Review the URLs. Relative URLs, URLs on another domain or on another host because of a www difference, http/https mix-ups, duplicates and URLs longer than 2,048 characters are listed as separate findings. The tool also checks the URLs against robots.txt and shows the blocked ones.
- Look at the dates. lastmod values that aren't in W3C format, lie in the future or are identical across all entries show up as warnings.
- Read the sample URL results. The tool opens 20 random URLs from the sitemap and shows pages that return errors, redirect, are noindex or have a different canonical URL. If problems turn up even in a small sample, there may be a systematic error in the source the sitemap is generated from.
- Check the full list. Download the URL list as a CSV and run it through the Bulk status code checker in batches of 100 URLs. A Site crawl, in turn, shows whether the pages in the sitemap receive internal links, that is, it reveals orphan pages.
- Confirm in Search Console. Resubmit the corrected sitemap and, a few days later, review the Page indexing report using the sitemap filter.
The validator examines at most 25 sitemaps and 50,000 URLs per check; on larger sites, check the sub-sitemaps one by one by entering their URLs.
Checklist
- The sitemap returns 200, is valid XML and carries the correct namespace.
- Each file has at most 50,000 URLs and its uncompressed size is under 50 MB.
- URLs are written in full, and all of them are canonical pages that return 200 and aren't noindex.
- lastmod is updated only when the content actually changes.
- On multilingual pages, all versions list each other reciprocally.
- The sitemap is declared in robots.txt and submitted to Search Console.
- Newly published pages are added to the sitemap automatically, and deleted ones are removed.
Frequently asked questions
Will Google find my pages without a sitemap?
Usually, yes, because Google discovers pages primarily by following links. On well-linked sites with fewer than about 500 pages, a sitemap isn't essential; on large, new or poorly linked sites, it makes new and updated pages easier to find.
Why isn't a page in my sitemap being indexed?
A sitemap only makes discovery easier; Google doesn't guarantee to crawl or index every URL on the list. Check that the page doesn't carry noindex, a redirect or a different canonical URL, and that it isn't blocked by robots.txt; if there's no technical problem, the reason is usually thin content or duplication with another page.
Should I include changefreq and priority?
There's no need. Google ignores both fields; they do no harm, but maintaining them is wasted effort. Use accurately kept lastmod values to signal which pages have changed.
Should I remove deleted pages from the sitemap?
Yes. Remove URLs that return 404 or 410, redirect to another URL or have been set to noindex. A sitemap should list only pages that exist and that you want to see in the index; make this permanent by generating the sitemap automatically from your content management system.
Should a sitemap be declared in robots.txt or in Search Console?
In both. The Sitemap line in robots.txt is read by Google, Bing and other search engines; submitting to Search Console lets you see whether the sitemap was read and how many URLs were found.
Does a multilingual site need a separate sitemap for each language?
No. You can list all language versions in a single sitemap or gather separate per-language sitemaps in an index. What matters is that each version appears with its own url element and that the hreflang links are reciprocal.
Related guides and tools
- Sitemap validator: checks the sitemap's format, its URLs and the status of sample pages.
- robots.txt tester: shows whether a URL is open to a specific bot and which line matches.
- Bulk status code checker: tests the status code and redirect of up to 100 URLs.
- Hreflang checker: checks a page's language versions and reciprocal links.
- Site crawl: checks the pages in the sitemap and those reached through internal links together.
- robots.txt guide: write the Sitemap line and your crawl rules correctly.
- hreflang guide: showing the right version on multilingual and multi-country sites.
- Technical SEO checklist: other settings related to crawling and indexing.
- SEO glossary: short explanations of technical terms.
- SEO guides: all the guides on Röntgen.