Back to Blog

How to Rewrite Canonical URLs in HubSpot for International SEO

May 4, 2026 4 min read
How to Rewrite Canonical URLs in HubSpot for International SEO

Canonical tags are one of those things that feel simple… until they’re not.

Most of the time, you follow the rule: Use self-referencing canonicals. Done.

HubSpot even recommends it in their settings. And in most cases, that works just fine. But if you’re running a multi-region, same-language website, especially at scale, that default behavior can start to work against you instead of for you.

This is one of those edge cases.

 

What are canonical URLs and why do they matter?

A canonical URL tells search engines:

“If multiple versions of this content exist, this is the one that should be treated as the primary.”

It’s not about what users see. It’s about how search engines consolidate authority, avoid duplication, and decide what ranks.

Without strong canonical signals, Google starts making decisions for you. And when that happens… it doesn’t always choose the page you want.

 

How does HubSpot handle canonical URLs by default?

HubSpot’s default recommendation is:

  • Add self-referencing canonical URLs to all pages and blog posts

hubspot-canonical-url-settings-defaults

This works well for:

  • Standard websites
  • Single-language setups
  • Basic multi-language (translation-based) sites

But it assumes something important: Each page is considered independent

That assumption breaks down when you introduce regional duplication.

 

The problem: regional localization without structural clarity

We worked with a site that had 11 English variations.

Not translations. Same language. Same content.
Just different regional URLs to create local trust and familiarity.

Here’s how it was structured:

Two primary clusters:

  • en-US
    • en-PH
  • en-GB
    • en-AU
    • en-CA
    • en-HK
    • en-IN
    • en-IE
    • en-NZ
    • en-SG
    • en-ZA

Other languages followed different patterns:

Dutch
  • nl-NL
    • nl-BE
French
  • fr-FR
    • fr-CH
    • fr-BE
German
  • de-DE
    • de-AT
    • de-CH
Standalone languages
  • it-IT
  • pt-PT
  • es-ES
  • ja-JP
  • ko-KR

The intent was solid:

  • Keep content consistent
  • Use automation to sync pages
  • Show region-specific URLs to users

But structurally… every page was saying:

“I am the canonical version of myself.”

Even when it clearly wasn’t.

 

How do you fix international canonical urls in HubSpot?

We opened Google Search Console and immediately saw the issue: “Duplicate, Google chose different canonical than user”

Over 20,000 pages flagged.

duplicate-Google-chose-different-canonical-than-user

 

That’s Google saying:

“You gave me canonical instructions… but I don’t trust them.”

And when Google doesn’t trust your canonical tags, it will:

  • Pick its own canonical
  • Rank unexpected pages
  • Split authority across duplicates

Which is exactly what happened. Secondary regions (like en-PH) started outranking primary regions (like en-US).

 

Why do self-referencing canonicals fail?

Self-referencing canonicals only work when:

  • Each page is meaningfully unique
  • Or duplication is minimal

In this case:

  • Content was duplicated intentionally
  • Pages were part of structured regional clusters
  • There was a clear primary vs secondary relationship

But the canonical logic didn’t reflect that. So Google had to guess.

How to rewrite canonical logic based on regional hierarchy with HubSpot Hubl code?

Step one was simple: Turn off HubSpot’s default self-referencing canonical setting

Step two was the real work: Build a rule-based canonical system that reflects content relationships

Here’s the exact implementation with hubl code:

{% raw %}
{# Capture the current URL #}
{% set current_url = content.absolute_url %}

{# 1. MASTER PROTECTOR: If it's already the US or GB master, 
skip to the self-reference at the end #} {% if "/en-us/" in current_url or "/en-gb/" in current_url
or "/de-de/" in current_url or "/fr-fr/" in current_url or "/nl-nl/" in current_url %} {# 2. ENGLISH - US CLUSTER: Only Philippines points to US #} {% elif "/en-ph/" in current_url %} {# 3. ENGLISH - GB CLUSTER: AU, CA, HK, IE, IN, NZ, SG, ZA point to en-gb #} {% elif current_url is string_containing "/en-" %} {# 4. GERMAN CLUSTER: AT and CH point to de-de #} {% elif "/de-" in current_url %} {# 5. FRENCH CLUSTER: BE and CH point to fr-fr #} {% elif "/fr-" in current_url %} {# 6. DUTCH CLUSTER: BE points to nl-nl #} {% elif "/nl-be/" in current_url %} {# 7. CATCH-ALL: Unique Regions (ja-jp, ko-kr, etc.) self-reference #} {% else %} {% endif %}
{% raw %}

 

What this actually does

This logic introduces structure where none existed before.

 

1. Secondary regions point to their primary

  • en-PH → en-US
  • en-AU → en-GB
  • de-CH → de-DE

This consolidates authority.

 

2. Primary pages stay self-referencing

  • en-US → en-US
  • en-GB → en-GB

This preserves ranking targets.

 

3. Standalone languages remain untouched

  • ja-JP
  • ko-KR
  • es-ES

No unnecessary overrides.

 

The simple result

Instead of Google guessing relationships… We defined them.

That leads to:

  • Stronger primary rankings
  • Reduced duplication signals
  • Clearer indexing behavior
  • More predictable SEO performance

And importantly, users still land on region-specific URLs and search engines understand which pages matter most.

 

When should you NOT use HubSpot’s default canonical setting?

Most sites should leave it on.

But you should consider overriding it if:

  • You have regional variations of the same language
  • Content is duplicated intentionally across regions
  • You’re seeing canonical conflicts in Search Console
  • Secondary pages are outranking primary ones
  • Your localization strategy is hierarchical, not flat

 

Do you need both Canonicals and hreflang?

This is where people get tripped up.

  • Canonical tags → tell Google which page is primary
  • Hreflang tags → tell Google which page to show to which user

You need both.

In this setup:

  • Canonicals consolidate authority
  • Hreflang preserves regional targeting

Without proper canonicals, hreflang can’t do its job effectively.

 

What results can you expect after fixing canonical structure?

Once the updated canonical logic was implemented, the impact was both fast and measurable.

We deployed the revised script in late March 2026 and began monitoring changes in Google Search Console almost immediately. The “Duplicate, Google chose different canonical than user” issue started to decline at a steady pace, with Google reprocessing and correcting close to 2,000 pages per week.

Within five weeks, more than 10,000 affected pages had been resolved.

This wasn’t a gradual or ambiguous improvement. It was a clear signal that Google now trusted the canonical structure and no longer needed to override it.

Just as important, the real-world impact aligned with the data. Since the fix, there have been no observed cases of incorrect regional pages surfacing in the wrong markets. Primary regions are now ranking as intended, while secondary regions continue to serve their purpose for localized user experiences.

When canonical logic accurately reflects the relationship between pages, search engines respond quickly and predictably.

 

Final takeaway

Canonical tags are not just a technical checkbox. They are a structural decision.

And when your content model becomes more complex… your canonical logic needs to evolve with it.

HubSpot gives you a strong default. But defaults are built for average use cases.

This wasn’t average.

 

If your HubSpot website has multiple regions, shared content, or complex localization… there’s a good chance your canonical setup needs a second look.

Contact us if you need help to clean it up.