# Defining Canonical Links

**URL:** <https://community.hubspot.com/t/defining-canonical-links/126759>\
**Category:** Content Strategy & SEO\
**Tags:** academy\
**Created:** [February 24, 2025, 9:47pm UTC](https://community.hubspot.com/t/defining-canonical-links/126759 "2025-02-24T21:47:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CTaipale](https://avatars.discourse-cdn.com/v4/letter/c/97f17d/32.png) [@CTaipale](https://community.hubspot.com/u/CTaipale)\
**Post date:** [February 24, 2025, 9:47pm UTC](https://community.hubspot.com/t/defining-canonical-links/126759/1 "2025-02-24T21:47:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![karstenkoehler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/karstenkoehler/32/68554_2.png) [@karstenkoehler](https://community.hubspot.com/u/karstenkoehler)\
**Post date:** [February 25, 2025, 5:20am UTC](https://community.hubspot.com/t/defining-canonical-links/126759/2 "2025-02-25T05:20:10Z")

</div>

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](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]](https://sitechecker.pro/site-audit-issues/canonical-from-http-to-https/)

Best regards

---

<div class="post-metadata">

**Author:** ![CTaipale](https://avatars.discourse-cdn.com/v4/letter/c/97f17d/32.png) [@CTaipale](https://community.hubspot.com/u/CTaipale)\
**Post date:** [February 26, 2025, 12:51am UTC](https://community.hubspot.com/t/defining-canonical-links/126759/3 "2025-02-26T00:51:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![karstenkoehler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/karstenkoehler/32/68554_2.png) [@karstenkoehler](https://community.hubspot.com/u/karstenkoehler)\
**Post date:** [February 26, 2025, 7:02pm UTC](https://community.hubspot.com/t/defining-canonical-links/126759/4 "2025-02-26T19:02:29Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![CTaipale](https://avatars.discourse-cdn.com/v4/letter/c/97f17d/32.png) [@CTaipale](https://community.hubspot.com/u/CTaipale)\
**Post date:** [March 1, 2025, 4:24am UTC](https://community.hubspot.com/t/defining-canonical-links/126759/5 "2025-03-01T04:24:12Z")

</div>

Thank you!
