Skip to main content

Confirm

Are you sure?

SEO · Checked on every page

Canonical URL (presence and consistency)What it checks and how to fix it

What it checks

Reads the page's <link rel="canonical">. Fails when there is none, when its href is empty or when it is not a valid URL. Warns when it is relative, when it points to another domain, or when it differs from the page's own URL only by protocol, www, a trailing slash or query parameters the page does not have. Passes otherwise.

Why it matters

The same content is usually reachable at several URLs (with and without www, trailing slash, tracking parameters). The canonical tells search engines which one to index, so links and ranking signals are not split across duplicates. Without it Google picks a URL for you, and an inconsistent canonical sends a mixed signal it may ignore or follow to the wrong page.

How to fix it

Add one absolute, self-referencing canonical to every indexable page, using exactly the protocol, host and path you
want indexed.

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

In a Rails layout, drop the query string so tracking parameters never become canonical:

<link rel="canonical" href="<%= request.base_url + request.path %>">

Then make the other variants redirect permanently to the canonical one, for example from http and www in nginx:

server {
  listen 80;
  listen 443 ssl;
  server_name www.example.com;
  return 301 https://example.com$request_uri;
}

Monitor this automatically

Full Stack Audit runs this check and 126 others on your site on a schedule, and emails you when one that passed starts failing.

More SEO checks