Tell Google which pages count with XML sitemaps and canonical tags

An XML sitemap is a file that lists the pages on your site you want search engines to find, and a canonical tag is a line of code that tells them which version of a page is the main one when several URLs show the same content. Together they answer one question for Google and Bing: which URLs count? The sitemap says “these are the pages worth crawling”, and the canonical tag says “of these near-identical versions, index this one”.
Neither is a command. Both are signals that search engines weigh alongside links, redirects and the content itself. Set up well, they help new pages get found faster and stop duplicate URLs from splitting your rankings. This guide explains what each one does, what to include, how to create and submit a sitemap, when to use canonical tags and the mistakes that cause indexing problems. It is part of our technical SEO guide.
What is an XML sitemap?
An XML sitemap is a machine-readable list of URLs on your site. Each entry gives the page address and, optionally, the date it last changed. Search engines read it to discover pages they might otherwise miss and to see when pages have been updated.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.co.uk/services/</loc>
<lastmod>2026-11-20</lastmod>
</url>
</urlset>A sitemap does not guarantee that a page will be indexed. It tells search engines a page exists and that you consider it important. Whether it is indexed still depends on quality, duplication and whether the page can be crawled.
Do you need an XML sitemap?
Google’s sitemap documentation says a small, well-linked site may not need one. In practice almost every business site should have one, because it costs nothing and helps in the situations where crawlers struggle:
- New sites with few links pointing to them.
- Large sites, such as online shops with thousands of product pages.
- Pages that are poorly linked from elsewhere on the site.
- Sites that change often, where you want updates picked up quickly.
What to include in your sitemap
A sitemap should list only the pages you want to appear in search results. Every URL in it should be the final, canonical version of the page.
- Include: pages that return a 200 status, can be indexed and are the canonical version, such as your homepage, service pages, product and category pages and blog posts.
- Leave out: redirected URLs, error pages, pages marked noindex and duplicates whose canonical tag points elsewhere. Thin pages such as tag archives, internal search results and thank-you pages do not belong there either.
Use the lastmod date only when it reflects a real change to the page content. Google says it ignores the priority and changefreq tags, and uses lastmod only when it is consistently accurate.

How to create an XML sitemap
- WordPress: WordPress has built a basic sitemap in at /wp-sitemap.xml since version 5.5. SEO plugins such as Yoast replace it with their own, usually at /sitemap_index.xml, and let you exclude content types and archives you do not want listed.
- Shopify, Wix and Squarespace: these platforms create a sitemap automatically at /sitemap.xml and update it as you add pages or products.
- Custom sites: generate the sitemap from your content database so it updates on its own. A crawler can produce one for a small static site, but it will go out of date.
Each sitemap file can hold up to 50,000 URLs or 50MB uncompressed, according to Google’s guide to building a sitemap. Larger sites split their URLs across several files and list them in a sitemap index, which is what most plugins do by default, often with separate files for posts, pages and products.
How to submit your sitemap
- Find your sitemap URL. Open it in a browser to check it loads and lists the pages you expect.
- Add it to robots.txt. A line such as “Sitemap: https://www.example.co.uk/sitemap_index.xml” tells every search engine where to look. Our robots.txt generator adds this line for you.
- Submit it in Google Search Console. Open the Sitemaps report, enter the sitemap URL and submit. The report shows when Google last read it and how many URLs it found.
- Submit it in Bing Webmaster Tools. Bing’s data also feeds other services, so it is worth the extra minute.
- Check it after changes. After a redesign, migration or plugin change, make sure the sitemap still loads and lists the right URLs.
What is a canonical tag?
A canonical tag is a link element in the head of a page that names the preferred URL for that content. It looks like this:
<link rel="canonical" href="https://www.example.co.uk/shoes/walking-boots/" />Duplicate URLs appear more often than most site owners realise. The same page can be reached with and without “www”, over http and https, with a trailing slash or without one and with tracking or filter parameters added. Online shops often show one product under several category paths. Without a clear signal, search engines pick a version themselves, and links and other signals may be split across the copies. Our glossary entry on duplicate content covers the wider issue.
When to use a canonical tag
- On every indexable page, pointing to itself. A self-referencing canonical confirms the preferred URL and protects against parameter and tracking variations.
- For filtered and sorted versions of a page. A category page sorted by price should usually point to the main category URL.
- For products in several categories. Choose one product URL and point the other paths to it.
- For content published in more than one place. If a partner republishes your article, ask them to add a canonical tag pointing to your original.
Do not use a canonical tag where a redirect is the better tool. If an old page has been replaced for good, a permanent 301 redirect sends people and search engines to the new one. A canonical tag suits pages that still need to exist for visitors, such as filtered views.
How Google treats canonical tags
Google’s guide to consolidating duplicate URLs describes canonical tags as a strong signal, not a rule. Google also looks at redirects, internal links, which URL appears in the sitemap, https and the content itself. If these signals disagree, Google may choose a different canonical from the one you set.

To see what Google decided, use the URL Inspection tool in Google Search Console. It shows both the canonical you declared and the one Google selected. The Page indexing report also groups affected URLs under statuses such as “Duplicate, Google chose different canonical than user” and “Alternate page with proper canonical tag”. The second status is normal: it means Google found a duplicate and followed your tag.
Common sitemap and canonical mistakes
- Listing non-canonical URLs in the sitemap. A sitemap URL that differs from the page’s canonical sends mixed signals. Google advises keeping them consistent.
- Including redirects, errors and noindex pages. They waste crawling and make the sitemap less trustworthy.
- Pointing every page’s canonical at the homepage. This tells Google most of your pages are duplicates of one page, and they may drop out of search.
- Using robots.txt to handle duplicates. A blocked page cannot be crawled, so Google never sees its canonical tag. Blocked URLs can still appear in results without a description.
- Mixing noindex and canonical on the same page. One says “do not index this”, the other says “index that instead”. Pick the signal that matches what you want.
- Relative or broken canonical URLs. Use the full, absolute address with the correct protocol and domain.
- Forgetting the sitemap after a migration. Old sitemaps full of redirected URLs slow down how quickly Google learns the new structure.
Frequently asked questions
What is an XML sitemap?
An XML sitemap is a file that lists the URLs on a website that the owner wants search engines to find and index, often with the date each page last changed. Search engines use it to discover pages and spot updates.
What is a canonical tag?
A canonical tag is a rel=”canonical” link in a page’s code that names the preferred URL when the same or very similar content is available at more than one address. It helps search engines index one version and combine signals from the duplicates.
Does Google always follow canonical tags?
No. Google treats a canonical tag as a strong signal but also weighs redirects, internal links, sitemaps and content. If the signals conflict, it may choose a different canonical. The URL Inspection tool in Search Console shows which one Google selected.
How many URLs can an XML sitemap contain?
Google accepts up to 50,000 URLs or 50MB uncompressed in a single sitemap file. Larger sites split their URLs across several sitemaps and list them in a sitemap index file.
Should every page have a self-referencing canonical tag?
It is good practice for every indexable page. A self-referencing canonical confirms the preferred URL and helps when tracking parameters or other variations create extra versions of the page.
On this page
Back to topMake sure Google indexes the right pages
Kutola audits your sitemaps, canonical tags and indexing reports, fixes the conflicts and keeps search engines focused on the pages that matter. See our SEO and AI search services, or get in touch to talk it through.


