Skip to content

SEO for websites

Canonical tags, 301 redirects and hreflang

A canonical tag names the main version of a page, a 301 redirect moves an address for good, and hreflang maps language versions. See when to use each.

By Leous · Updated · 4 min read

Cover image for the article “Canonical tags, 301 redirects and hreflang” on the Leolinq blog

A canonical tag tells Google which URL is the main version when several URLs show the same content. A 301 redirect sends users and crawlers from an old address to a new one for good. Hreflang declares the versions of a page for different languages or countries. All three answer one question: which URL is the right one.

This guide explains each tool, when to use it and the mistakes that come up most.

What a canonical tag is

The canonical tag sits in the <head> of a page:

<link rel="canonical" href="https://www.example.com/services/">

Diagram of a canonical tag
A canonical tag gathers the URL variants of one piece of content onto a single main address.

It says: if this content appears at several addresses, treat this one as the original. Google consolidates ranking signals on the canonical URL and shows that one.

A canonical is a hint, not a command. Google can choose another URL when other signals disagree.

When you need a canonical

  • URLs with parameters: ?utm_source=..., ?sort=price, ?page=2.
  • One product in several categories with several paths.
  • Trailing-slash and letter-case variants.
  • Syndicated content: the copy points its canonical at the original.

A sound default is a self-referencing canonical on every page. Parameter variants then fold back to the clean URL automatically.

What a 301 redirect is

A 301 is a permanent server-side redirect. Anyone requesting the old URL is sent straight to the new one, and Google moves most ranking signals with it.

Diagram of a 301 redirect
A 301 redirect takes both users and Googlebot from the old URL to the new one, along with most ranking signals.

Use a 301 when you:

  • Change the URL of a page.
  • Merge two pages into one.
  • Delete a page that has a suitable replacement.
  • Move from HTTP to HTTPS, or settle on www or non-www.
  • Change domain.

301 versus 302: a 301 is permanent, a 302 temporary. Use a 302 for short-term changes such as maintenance. For anything lasting, use a 301.

Canonical or redirect

  • Nobody needs the old URL any more → 301 redirect.
  • Both URLs must keep working, such as filtered views on an ecommerce site → canonical.
  • The page is gone and nothing replaces it → return a 404 or 410. Do not redirect every deleted page to the home page.
Drawing of routes “Canonical or 301: choose by situation”
Three common situations and the tool that fits each one.

What hreflang is

Hreflang tells Google which language or regional versions of a page exist, so each user sees the right one:

<link rel="alternate" hreflang="en" href="https://example.com/services/">
<link rel="alternate" hreflang="vi" href="https://example.com/vi/dich-vu/">
<link rel="alternate" hreflang="x-default" href="https://example.com/services/">
Diagram of two-way hreflang
Hreflang must be declared both ways: each version points to itself and to every other version.

Three rules:

  1. Annotations are reciprocal. The English page references the Vietnamese page and the reverse. A missing return link makes Google ignore the pair.
  2. Each version references itself.
  3. Use valid codes. ISO 639-1 for language (en, vi), optionally with a region (en-us, en-gb). x-default is the fallback when no language matches.

Hreflang does not improve rankings. It gets the right version in front of the right person.

Using the three together

  • Each language version has a canonical pointing to itself, never to another language.
  • Hreflang points only to final URLs, not to URLs that redirect.
  • After a URL change, update canonicals, hreflang, the sitemap and internal links to the new address.

Key point One piece of content, one main address. Canonical, 301 and hreflang are three ways of telling Google that in three different situations.

Common mistakes

  • Every page canonicalized to the home page. A configuration fault that drops the whole site from the index except the home page.
  • A canonical pointing to a noindex page, a 404 or a redirect.
  • Redirect chains. A to B to C. Point A straight at C.
  • Redirect loops.
  • A redesign or migration with no redirect map. Rankings and old backlinks are lost with it.
  • One-way hreflang, or wrong codes such as uk for British English instead of en-gb.
  • A translated page canonicalized to the original language.
  • Internal links still pointing at redirected URLs. See on-page SEO and internal linking.

How to check

  • View the page source and look for rel="canonical" and hreflang.
  • URL Inspection in Search Console shows the canonical you declared and the one Google selected. If they differ, find out why.
  • A redirect checker or the browser’s Network tab shows status codes and chains.
  • A site crawler covers the whole site at once.

Backlinks keep pointing at old URLs for years. A 301 carries their value to the new page; a 404 throws it away. Before removing or renaming a page, check whether it has links. See how to check backlinks.

Frequently asked questions

Does a 301 redirect lose ranking?

Not noticeably, when it leads to an equivalent page. Positions can move for a few weeks while Google processes the change.

How long should a 301 stay in place?

At least a year, and ideally for good, since old links keep sending visitors and crawlers.

Does a single-language site need hreflang?

No. It is only needed when the same content exists in several language or regional versions.

These items belong to the indexing part of technical SEO and to every SEO audit. Duplicate URLs are also a common reason a page is left out of the index: see Google indexing. In Leolinq’s SEO packages, they are reviewed in the technical audit.

Further reading

Official documentation and reference pages on this topic:

Keep reading More on entity, and backlinks.

Want this done for your site?

Send your domain. We reply within one working day with a first look at your site and a clear quote.

Get a free audit