What is an XML sitemap and why is it important?
An XML sitemap is a file with the most important URLs on your website that you want search engines to discover. It helps Google find new and updated pages faster. A sitemap does not automatically create indexation or higher rankings. For that, your pages still need to be technically sound, indexable, and useful.
In this guide, you will learn which URLs belong in a sitemap, how to check the file, and how to fix common problems. You will also learn how lastmod, sitemap indexes, images, and multiple languages work. Always start with the real canonical URLs on your website.
- What is an XML sitemap and why is it important?
- Which URLs belong in an XML sitemap?
- How do you create an XML sitemap?
- How do you check a sitemap on your own website?
- Which errors most often block discovery?
- How do you use Search Console for sitemaps?
- What questions are frequently asked about XML sitemaps?
What is an XML sitemap and why is it important?
XML is a structured file format that machines can read. In a sitemap, you include at least the full location of every listed URL. You can also add information about the last meaningful update and about certain images, videos, news articles, or language versions.
A sitemap mainly helps with page discovery. Google finds most pages through links, but a sitemap adds an extra route. That is useful for new websites, large websites, pages with few external links, and large archives with lots of content.
Google also uses URLs from a sitemap as a weak canonical signal. So only include your preferred versions in the file. A redirect, error page, noindex page, or duplicate normally does not belong there.
An XML sitemap is not the same as an HTML sitemap for visitors. An HTML overview can help visitors navigate. The XML file is mainly meant for search engines and does not need to look nice for people.
Many content management systems and WordPress plugins create a sitemap automatically. Do not trust that blindly. A plugin can also add unwanted tags, archives, attachment pages, and parameter URLs. So check regularly which URLs are really in the file.
Why does an XML sitemap affect visibility in Google?
A page must first be known to Google before Google can crawl it and possibly index it. A sitemap can bring new or changed URLs to attention. That is especially useful when internal links to those pages are still limited.
Discovery is only the first step. Google decides for itself whether and when a URL is crawled, indexed, and shown in search results. A sitemap does not make thin, duplicate, blocked, or unreliable content better.
A clean sitemap also helps with technical checks. In Search Console, you can see whether Google has read the file and how many URLs were discovered. By using separate sitemaps for different content types, you can track these groups more easily.
The sitemap confirms which URLs you see as the preferred versions. Combine this with self-referencing canonicals and internal links to exactly the same versions. Conflicting signals make it harder for Google to choose the right URL.
So think of a sitemap as a roadmap, not a ticket to entry. The doors still need to be open. The pages also need useful, unique, and indexable content.
Which URLs belong in an XML sitemap?
Only include URLs that you really want to show in Google. They should return a successful status code, be indexable, and count as the canonical version.
Always use full absolute URLs. So include the protocol, the domain, and the full path. Google tries to crawl every URL exactly as it appears in the file.
Include important pages such as products, categories, services, landing pages, and articles. For each page, choose only the correct language, host, and protocol variant.
Also check whether every listed URL contains content that is useful to visitors. Being technically indexable is not enough. An empty category or an almost identical page can still stay out of the index.
Leave out redirects, 404 pages, noindex pages, duplicate parameters, and URLs from a test environment. By including these URLs, you signal that you want them indexed. Other settings then tell Google something different again.
Compare every new sitemap with the real website. An automatically generated file can keep old or removed routes if the data source is not updated properly.
Which URLs should not be in an XML sitemap?
Internal search results, shopping carts, account pages, login pages, and private content normally do not belong in search results. So do not place them in the sitemap either.
Filters and sort parameters without a unique search value usually do not belong there. Use the clean category URL or deliberately create a useful, unique landing page for a valuable filter.
Old redirected URLs do not belong in the file. Put only the new final destination in the sitemap. Also read how to use a 301 redirect correctly.
Do not place an HTTP version in the sitemap when HTTPS is your preferred version. Also avoid duplicate www variants, case differences, and duplicate versions with or without a trailing slash.
A URL that is blocked through robots.txt but still appears in the sitemap sends conflicting signals. First decide what your goal is. If you want Google to evaluate the page, crawling must be possible. If you do not want the page indexed, it usually does not belong in the sitemap.
Drafts, expired temporary pages, and URLs from a staging environment also do not belong in the file. Check this especially carefully after an import, migration, or plugin change.
How do you create an XML sitemap?
Let a content management system generate the file automatically when it can do that reliably. This way, you do not have to adjust the sitemap manually when you add, change, or remove a page.
For a very small static website, you can create a sitemap by hand. Use valid XML, UTF-8, and full URLs. Check the file after every change, because one small mistake can stop Google from reading it.
A sitemap can be at most 50 MB uncompressed or contain 50,000 URLs. Is your website larger? Then split the URLs across multiple files and use a sitemap index.
Preferably place the sitemap in the root of the website. That way, the file can cover all relevant paths. Another location is also possible, especially if you submit the sitemap directly through Search Console.
You can also add the location to robots.txt. In addition, submit the sitemap directly in Search Console and then check whether Google can process the file without problems.
Use a fixed and recognizable location. Do not change the address without a reason. If the address does change, update robots.txt, Search Console, and any internal technical documentation.
How do you check a sitemap on your own website?
First open the sitemap URL in your browser. Check whether the file is reachable, does not ask for a login, and returns a successful status code. Test this also in a window where you are not logged in.
Then validate the XML structure. A missing closing tag, the wrong character, or an encoding error can make the file unreadable.
Crawl all included URLs. Group the results by status codes, noindex settings, canonicals, and robots.txt blocks. Every deviation deserves investigation.
Then compare the sitemap with a full crawl of your website. Look for important indexable pages that are missing. Also check which unwanted URLs do appear in the sitemap.
In Search Console, review the status, the last read date, and the number of discovered URLs. Inspect important examples separately when crawling or indexation falls behind.
| Check point | How to check it | Solution | Priority |
|---|---|---|---|
| Sitemap is not reachable | Open the URL and check the status code | Fix the server, path, or access | Very high |
| File contains redirects or errors | Crawl all URLs from the sitemap | Replace them with working canonical URLs | Very high |
| Noindex page is in the sitemap | Compare meta robots and HTTP headers | Remove the URL or correct an unintentional noindex | High |
| Canonical points to another URL | Crawl the canonicals and use URL inspection | Only include the real main version | High |
| Lastmod changes without content changes | Compare the date with the publication log | Update the date only after a real change | Normal |
| Important page is missing | Compare the website crawl, inventory, and sitemap | Add the correct indexable URL | Normal |
How do you use lastmod correctly?
Lastmod shows when a page was last meaningfully changed. Google can use this information when the value is reliable and verifiable.
Do not change lastmod for every visitor, small technical load action, or daily automatic generation. A date that always shows today quickly loses its meaning.
Do update lastmod after a content change. Think of new explanations, changed product specifications, current figures, an important correction, or a clear expansion of the page.
Use the correct date format. Let your CMS pull the date from a real content change. So do not automatically use the moment the sitemap file was regenerated.
Google ignores the changefreq and priority values. So spend your time mainly on clean URLs, good internal links, and honest lastmod data.
How do you use a sitemap index?
A sitemap index points to multiple separate sitemap files. This is needed when you go above the limit of one sitemap. It is also useful when you want to manage and measure different groups of URLs separately.
For example, split blogs, products, categories, and languages. This lets you see in Search Console more quickly which group has errors or indexation problems.
Each underlying sitemap must itself be valid, current, and reachable. A sitemap index does not hide errors in an underlying file.
Use clear and fixed filenames. Do not create an endless collection of old versions that all stay reachable and may contradict each other.
Submit the sitemap index in Search Console. Then you do not need to add each underlying sitemap separately. For a focused analysis, it can sometimes still be useful to inspect a single file on its own.
Which errors most often block discovery?
Thinking that a sitemap guarantees indexation
Google decides for itself which pages enter the index. Solve technical problems, low quality, and duplication separately. A listing in the sitemap is only a request for discovery.
Automatically including every found URL
A sitemap is a selection of preferred URLs. It is not a full export of every path your system has ever created.
Including redirects and noindex pages
This sends conflicting signals. Only include working, indexable final pages that you want to show as search results.
Refreshing lastmod every day
Use the date only for real and important changes. Unreliable data does not help Google and may eventually be ignored.
Forgetting internal links
A sitemap does not replace logical navigation. Important pages must also be reachable through normal crawlable links. This helps both visitors and search engines.
Leaving the old sitemap in place after a migration
Update the host, protocol, paths, and canonicals. Also check that the new file does not contain old URLs that redirect directly.
Never checking an automatic file
Plugins and platform settings can change. So after updates, migrations, and major publications, check whether the sitemap still contains the right URLs.
How do you improve an XML sitemap step by step?
- Find all sitemap files and sitemap indexes on your website.
- Check whether each file is reachable and contains valid XML.
- Crawl every included URL and collect the technical data.
- Remove error pages, redirects, noindex pages, and duplicates.
- Add missing important canonical URLs.
- Use full absolute HTTPS addresses.
- Make lastmod reliable and tie it to real changes.
- Split large or clearly different groups when that is useful.
- Submit the correct sitemap or sitemap index in Search Console.
- Track errors, discovered URLs, and indexation by group.
View the sitemap as part of broader SEO work. Content, technical setup, canonicals, and internal links must all support the same preference.
How do sitemaps work together with internal links?
Google discovers many pages through links. A URL that appears only in the sitemap and is not mentioned anywhere internally may seem unimportant or disconnected.
Link important pages from relevant categories, articles, and navigation areas. Use normal anchor elements with an href and clear, descriptive anchor text.
The sitemap works as a safety net and technical overview. Internal links provide context, hierarchy, and a route for visitors. Both should point to the same canonical URL.
Find isolated pages by comparing the sitemap with a full website crawl. Add a logical internal route or judge whether the page is still needed.
A strong internal structure also helps Google understand the relationship between topics. The sitemap mainly tells which URL exists. Internal links tell where the page belongs and how important it is within the website.
How do you use sitemaps for images, video, and news?
XML sitemaps can contain extra information about images and videos. This can help discover media that would otherwise be difficult to reach.
Only use supported fields and follow Google’s current documentation. Do not invent metadata just to use more fields.
A news sitemap has separate requirements and contains recent articles that are suitable for Google News. A regular blog does not automatically become part of Google News simply by publishing such a file.
Images and videos must be accessible to Googlebot. A sitemap cannot fix a block, server error, missing file, or rights issue.
Also check whether the media belongs to the correct canonical page. Do not add images that are only available on another URL or behind a login.
How do you manage sitemaps for multiple languages?
You can use separate sitemap files per language. This makes control easier. Each URL must represent the right language, region, and canonical version.
Google supports hreflang annotations in sitemaps. These relationships must be complete and reciprocal. Use this option only when you can maintain the data reliably.
Do not use a Dutch URL as the canonical for a separate German translation. Each real language version normally points to itself as canonical and is connected to the other versions through hreflang.
After a translation, check that there is no draft, old slug, wrong language code, or incorrect host in the file. Let the generator include only published language versions.
Optionally split sitemaps by language when you want to investigate differences in crawling and indexation. This makes it easier to see whether a problem occurs in only one language version.
How do you use Search Console for sitemaps?
Open the Sitemaps report and submit the full URL of your sitemap or sitemap index. Then check whether Google can fetch and read the file.
Look at the last read date and the number of discovered URLs. A successful status does not mean every URL has been indexed. It only means Google could process the file.
Use the Page indexing report to see why URLs were excluded. Inspect important examples separately with URL Inspection.
Split sitemaps by content type when you want to measure more precisely. Then you can see more quickly whether products, blogs, categories, or a specific language has problems.
Remove old submitted sitemaps when they are no longer valid. Make sure robots.txt and your internal technical documentation point to the current version.
Also watch for sudden changes in the number of discovered URLs. An unexpected drop can point to an error in the generator, publication status, or sitemap index.
What measurement shows whether an XML sitemap works?
The sitemap must be fetched successfully and read without parse errors. This is the first and most important technical measurement.
Compare the number of found URLs with what you expect. A sudden drop can point to a generation error, a wrong filter, or a problem with publication status.
Check by group how many important URLs have been indexed and why other pages were excluded. Do not blindly aim for 100% indexation. Some exclusions can be logical and intended.
On large websites, also review crawl statistics and server logs. A clean sitemap can support discovery, but good internal links remain important.
Backlinks can also help with discovery, authority, and traffic. Read why backlinks are still important in 2026. Never treat a sitemap as a replacement for relevant links.
What does a practical sitemap example look like?
Imagine a webshop has 20,000 product URLs in the sitemap. A crawl shows that 3,000 of those URLs redirect, 500 pages have a noindex setting, and 2,000 URLs are parameter duplicates.
The team adjusts the generator. Only published products with status 200, a self-referencing canonical, and indexable content remain in the sitemap. Redirects are replaced by their final destinations.
Products and categories get separate sitemaps within one sitemap index. Search Console can now track the groups separately. Lastmod changes only after real product updates.
After submission, the team checks the discovered URLs and the reasons for exclusion. It does not expect automatic ranking improvement. It has, however, created a cleaner, clearer, and better measurable route for discovery.
How do you automate a sitemap without adding mess?
Let the generator pull only published and indexable records. Check the status code, canonical, and public access before a URL is added.
Remove a URL automatically when a page is deleted, redirected, or set to noindex. Add the final destination when it meets all conditions.
Create tests for each content type. A blog, product, category, and language version can have different publication rules.
Set up an alert for a sudden large rise or drop in the number of URLs. Such a change can point to an error in an import, plugin, filter, or publication status.
Also do sample checks. Automation saves time, but a manual review can find errors that a technical test does not catch.
How do you check a sitemap after a migration?
Create a new file with the new host, the correct protocol, and the new paths. Check that no test domain or old redirect remains in the list.
Crawl all new URLs and compare them with the migration URL mapping. Every important new destination should be reachable, indexable, and correctly linked.
Submit the new sitemap in the correct Search Console property. You can temporarily keep old sitemaps available while Google processes the move, but make sure they fit the migration strategy.
Track both properties and review the server logs. Fix errors before you fully shut down the old infrastructure.
Also check internal links, canonicals, and hreflang references. A perfect sitemap cannot solve conflicting migration signals elsewhere.
How do you use separate sitemaps for better analysis?
Split sitemaps by content type, language, or freshness when that gives you useful diagnostics. Do not create hundreds of small files without a clear purpose.
A separate product sitemap quickly shows whether products are indexed differently from categories. A separate language sitemap helps you find errors by language or region.
Use fixed names and preferably place the files in one sitemap index. Record which generator creates each file and who is responsible for checking it.
Compare discovered and indexed URLs by group. Investigate important exclusion reasons with examples in URL Inspection.
A clear split makes reporting easier, but it does not change the quality of the pages. Every included URL must still meet the technical and content requirements on its own.
How do you keep lastmod reliable at scale?
Link lastmod to real content fields. A changed price, stock level, specification, or main text can be a meaningful change, depending on the page type.
A technical update without a visible change on the page does not need to refresh every lastmod value. Otherwise, it looks as if the whole website gets new content every day.
Keep the time zone and date format consistent. Test that import processes do not automatically replace an old modified date with the import date.
Check samples against the content log. Fix the source of an error instead of editing loose XML lines by hand.
Decide per content type what counts as a meaningful change. For a product, a price change can matter, while a small formatting tweak usually does not.
How do you protect a sitemap against unwanted URLs?
Filter drafts, private content, search results, sessions, and test hosts directly at the data source. A robots.txt block afterward is not enough for a clean file.
Check the domain and protocol before a URL is published. A wrongly configured environment can accidentally add URLs from localhost or staging.
Validate user input before it becomes part of a path. A sitemap should contain only valid URLs from your own website.
After every major plugin update or platform update, run an automatic check and a manual sample review.
Also limit who can change the generator settings. A wrong selection or filter can publish thousands of unwanted URLs in a short time.
How often should you update an XML sitemap?
Update the file when indexable URLs are added, removed, or changed permanently. A dynamic website can do this directly after publication. A small static website can regenerate the sitemap with every content release.
You do not need to resubmit an unchanged sitemap in Search Console every day. Google can fetch a known file again. Resubmit it when the location or structure changes or when you have fixed an error.
Regularly check whether the generator still works. A silent error can keep old URLs visible for weeks. So set up an alert for failed generation or a noticeable change in counts.
Let the frequency match your content. A news website changes more often than a small service website. Reliability matters more than an artificially high speed.
What do you do when Google cannot read the sitemap?
Open the exact URL without a logged-in session. Check the status code, redirects, certificate, and any firewall. Googlebot must be able to fetch the file publicly.
Validate the XML and encoding. Remove invalid characters and check the namespaces. One small structure problem can block an entire file.
Check the file size and the number of URLs. Split the file when a limit is exceeded and use a sitemap index.
After the fix, submit the sitemap again and review the new status. If the problem remains, check the server logs for requests from Googlebot.
Keep an example of the error and the solution used. This helps developers recognize and fix the same issue faster after a later update.
What questions are frequently asked about XML sitemaps?
Why is an XML sitemap important for SEO?
An XML sitemap helps search engines discover important preferred URLs. This is especially useful for new, large, or technically complex websites. The file does not guarantee indexation or higher rankings.
How do I check a sitemap myself?
Open and validate the file, crawl all included URLs, and check status codes, canonicals, noindex settings, and blocks. Then review the processing in Search Console.
Which tool do I need for this?
Search Console is the free starting point. A website crawler and XML validator are useful for larger files and deeper technical checks.
How quickly will I see results?
Google can read a sitemap quickly, but crawling and indexation do not have a fixed timeline. There is also no guarantee that every included URL will be indexed.
What is the most common mistake?
The most common mistake is including every available URL, including redirects, error pages, parameters, and duplicates. A sitemap should contain only real preferred URLs.
Does every indexable page need to be in the sitemap?
Important canonical pages should preferably be included. A missing URL can still be discovered through internal or external links, but a complete and clean selection makes control easier.
Can a sitemap fix bad internal links?
No. A sitemap gives Google an extra route, but it does not replace a clear website structure. Important pages must also be reachable through normal internal links.
When is help from a specialist useful?
Technical help can be useful for very large websites, multiple languages, news, video, migrations, or complex automatic generation. A specialist can help prevent conflicting signals and scalable errors.
Which SEO action has the highest priority now?
Crawl all URLs in your sitemap today. First filter for statuses that are not 200, noindex settings, and canonicals that point to another URL. Remove or correct these conflicts in the generator.
Then check which important indexable pages are missing. Add only the real canonical versions and make sure these pages are also reachable through internal links.
A good XML sitemap is valid, current, clear, and honest. The file contains only pages that you really want to show as search results. Always use the sitemap together with strong internal links, correct technical settings, and useful content.
