XML sitemaps and canonical tags

The same store page is available at five URLs: with a filter, with a sort order, with a UTM parameter from a campaign. Google has to pick one and often picks the wrong one. Sitemaps and canonical tags tell it which URLs are the real ones. We set them up so they tell the truth.

01

Two signals, one message

An XML sitemap is a list of URLs you want Google to follow. A canonical tag is a note on the page itself saying "the main version of this content is this URL". Both are hints, not commands, and Google only follows them when they agree with everything else it sees on the site.

When the sitemap lists one URL, the canonical another and internal links point to a third, Google chooses for itself. That's where the problems start.

02

Mistakes we keep finding

  • sitemaps full of URLs that redirect, return a 404 or carry noindex
  • a sitemap nobody has updated since launch, missing every new page
  • a canonical pointing to the homepage on every page, because the theme was set up that way
  • page two of a paginated list canonicalized to page one, leaving the products on page two without a link
  • URLs with and without a trailing slash, with and without www, both live and both indexed
  • canonicals with http:// on a site that runs on https://
03

Duplicates from filters and parameters

Most duplicates are created by the site itself. A store with 2,000 products and a few filters can easily generate hundreds of thousands of URLs. Some of them deserve a place in search, such as "men's sneakers size 10" if people search for it. Most don't.

For each group of URLs we decide: does it get its own indexed page, a canonical to the base category, or noindex. That's done once, in the template, not page by page.

04

Part of technical SEO

Sitemaps and canonical tags are the part of technical SEO that directly affects indexing. If Google doesn't know which URL is the main one, it splits signals across several versions of the same page and none of them ranks as it should.

05

How we work

We crawl the site and compare three lists: the URLs in the sitemap, the URLs with a self-referencing canonical and the URLs internal links point to. Anything that doesn't match is a candidate for fixing. In Search Console we check which URL Google chose as canonical, because it isn't always the one you marked.

Then we set the sitemap to regenerate on its own, with accurate last-modified dates, and fix the canonicals in the templates.

FAQ

Questions about sitemaps and canonical tags

No. The sitemap should only list pages that belong in the index, return status 200 and have a self-referencing canonical. Filters, search, the cart and login pages stay out.

Because it sees different signals: internal links point to another URL, that URL is in the sitemap or has more external links. Once all the signals line up, Google usually accepts your choice.

No. If two pages are nearly identical and both need to exist, a canonical helps. If one of them is redundant, it's better to merge them and add a 301 redirect. Google can also ignore a canonical when other signals contradict it.

Ideally automatically, every time a page is published or changed. A hand-made sitemap goes stale within weeks and starts sending Google URLs that no longer exist.

Is Google showing the wrong versions of your pages?

Send us your URL. We'll compare the sitemap, canonical tags and internal links and show you where they disagree.

Request a free estimate →