Defining Canonical Links

Hey all! I need some advice on this…

Seeing as how search engines like Google view a page with www vs no www like different pages, should I include www in my canoncial links? Or leave it out?

What about HTTPS? Should include that part?

Hi @CTaipale,

You should use the exact version of your URL that you want to be indexed. That means:

  • www vs. non-www: If you’ve chosen to use www (or not) as your canonical domain, then include it in your canonical URL.
  • HTTPS vs. HTTP: Always include the protocol. If your site is served over HTTPS (as it should be nowadays), then your canonical URL should include https://.

For example, if your preferred version is https://www.example.com, your canonical tag should look like this: <link rel=“canonical” href=“https://www.example.com/page” />

This tells search engines exactly which version to index, avoiding duplicate content issues.

See for example here: URLs with “Canonical from HTTP to HTTPS” [Guide on How to Fix Them]

Best regards

Thank you! So if I understand correctly, this is more just a matter of preference of how you want your brand displayed? I’m assuming www vs no www does not effect the ranking in this case?

@CTaipale Exactly. The choice between www and non-www is mainly a branding and consistency decision. As long as you properly set your canonical URLs (and use 301 redirects if needed) to indicate your preferred version, search engines will treat them as the same site. There should be no inherent ranking advantage to one over the other.

Thank you!