Fix your canonical tag
By Chris Hornak · Steps last checked · Part of the Swift Site Audit support pages
The short answer
A canonical tag tells Google which address is the main one for a page. It is one line in the page code: <link rel="canonical" href="https://example.com/">. Google calls it a strong signal, not a rule, so it can still pick another address. Give each page one canonical tag that points to its own full address, and never two that disagree.
Even a one-page site can need one. The same page often opens at several addresses, and Google can treat them as copies of each other. Google's own list of causes includes the HTTP and HTTPS versions of a site.
| Address | Same page? |
|---|---|
| https://example.com/ | The one you want Google to show |
| https://www.example.com/ | Yes, with www |
| http://example.com/ | Yes, without the lock |
| https://example.com/?utm_source=newsletter | Yes, with a tracking tag from an email |
A canonical tag on the page names the first one as the main address.
From our audit data: The audit read 82 of our 93 test homepages. The other 11 blocked it or failed to load. Of the 82, 14 had a canonical problem: 13 had no canonical tag, and 1 had two that disagreed, one address with www and one without.
What the audit found
The audit reads the page you tested. Find the line your report shows, then jump to its fix.
No canonical tag
Your report says: Canonical URL · Not set
The page has no canonical tag. This is a warning, not a failure: without one, Google picks the main address on its own. Google recommends a tag on the main page itself that points to its own address. If the page also has a noindex tag, fix that first. Yoast and Rank Math leave the canonical tag off any page set to noindex, on purpose.
<head>
<title>Healthcare IT Staffing | Example Staffing Co.</title>
</head><head>
<title>Healthcare IT Staffing | Example Staffing Co.</title>
<link rel="canonical" href="https://example.com/">
</head>Fix: add one canonical tag inside <head> with the page's full address, starting with https://. Most platforms do this for you once it is switched on. Find yours below.
Two canonical tags that disagree
Your report says: Canonical URL · 2 conflicting canonical tags
The page has two or more canonical tags that name different addresses, such as one with www and one without. Google tells site owners not to name different addresses as the main one for the same page. Webflow's help says plainly that multiple canonical tags may be ignored by search engines entirely. Two tags usually means two parts of your site each add one: the platform, a plugin, an app, or code pasted into the page.
<head>
<title>Healthcare IT Staffing | Example Staffing Co.</title>
<link rel="canonical" href="https://example.com/">
<link rel="canonical" href="https://www.example.com/">
</head><head>
<title>Healthcare IT Staffing | Example Staffing Co.</title>
<link rel="canonical" href="https://example.com/">
</head>Fix: keep one. Remove the extra tag where it comes from, and make sure the one left is the full https:// address you want Google to show.
Make the change on your platform
Plain code shows first. Pick your platform and we remember it on every support page.
Plain code
Plain HTML
Put one canonical tag inside <head> on every page. Use the full address. Google says to use absolute paths, not relative ones like /services.
<head>
<link rel="canonical" href="https://example.com/services">
</head>
Two tags? Open the page source, search for canonical and delete the extra one.
Next.js
Set metadataBase once in the root layout, then give each page its own canonical:
// app/layout.tsx
export const metadata = { metadataBase: new URL('https://example.com') }
// app/services/page.tsx
export const metadata = { alternates: { canonical: '/services' } }
A canonical in the root layout applies to every page that doesn't set its own. If it says '/', every page names your homepage as its main address.
Source: Google Search Central: Specify a canonical URL · Next.js: generateMetadata
WordPress
Yoast SEO
If you leave it empty: Yoast adds a canonical tag to every page, pointing to that page's own address. It removes the one WordPress adds, so there is only one.
Not set
- Check that the page isn't set to noindex. Yoast adds no canonical tag to a noindex page.
- Open the page in the editor. In the Yoast sidebar, open the Advanced tab.
- Leave Canonical URL empty to use the page's own address, or paste a full address to point elsewhere. Update the page.
Two tags
Yoast says each page should have only one canonical tag. Check whether your theme, a page builder or a second SEO plugin adds one too, and turn it off there.
Source: Yoast: Canonical URL tags · Yoast: rel=canonical guide
Rank Math
If you leave it empty: Rank Math adds its own canonical tag and removes the one WordPress adds. It leaves the tag off pages set to noindex.
Not set or wrong address
- Open the page in the editor and click the Rank Math icon.
- Open the Advanced tab and check the Canonical URL field. Update the page.
No Advanced tab? Go to Rank Math SEO › Dashboard and switch to Advanced Mode.
Two tags
Rank Math's help says your theme or another plugin can add the same tag. To find which one:
- Install the Health Check & Troubleshooting plugin.
- Go to Tools › Site Health › Troubleshooting and click Enable Troubleshooting Mode.
- Turn on Rank Math, then your theme and plugins one at a time. When a second tag shows up, change that one's settings or remove it.
Source: Rank Math: Setting canonical URLs · Rank Math: Fix duplicate meta tags
No SEO plugin
Good to know: WordPress adds a canonical tag only to published posts and pages. Your blog page, category pages and archives get none. A homepage that shows your latest posts gets none either.
- Add an SEO plugin, such as Yoast SEO or Rank Math. Both add a canonical tag to every page.
- Then follow that plugin's steps above.
Source: WordPress code: rel_canonical()
Squarespace
Good to know: Squarespace adds the canonical tag for you and has no field to change it. The Squarespace homepages we tested each had one tag.
Two tags, or a wrong address
- Open the page's settings, then the Advanced tab. Look in Page header code injection for a line with
rel="canonical"and delete it. - If someone added code to your whole site's header, look there too.
- Still wrong? Contact Squarespace support.
Source: Squarespace: Page settings · Squarespace: Understanding Google SEO emails and console errors
Shopify
Good to know: Shopify has no canonical field. The theme adds the tag. Shopify's Dawn theme has this line in theme.liquid:
<link rel="canonical" href="{{ canonical_url }}">
Not set
- Duplicate your theme first, as a backup.
- Go to Online Store › Themes, click the actions menu (…) and choose Edit code.
- Open layout › theme.liquid. Put the line above inside
<head>and Save.
Two tags
Search your theme code for canonical. Keep the line above, delete the other one, and check the settings of any SEO app you use.
Source: Shopify.dev: canonical_url · Shopify Dawn theme: theme.liquid
Webflow
The whole site
- Go to Site settings › SEO and find Global canonical tag URL.
- Type your main address, such as
https://www.example.com. Includehttps://, and includewwwif your main domain uses it. - Leave off the slash at the end. Webflow warns that a slash there gives every page a double slash, like
//contact. - Save and publish.
One page
- In the Pages panel, open the page's Page settings › SEO settings.
- Type the full address in Page canonical URL. Save and publish.
Two tags
Webflow says that if you add a canonical tag with another tool, such as Google Tag Manager, you shouldn't also set the global one. Pick one place.
Source: Webflow Help: Set canonical tags
Framer
Good to know: Framer uses each page's own address as its canonical by default. If your domain is connected to Framer, you usually don't need to change anything.
If Framer runs inside a bigger site
- Open your project's Settings › Domains and scroll to Canonical URL.
- Type your main address, such as
https://example.com, and publish again. - Open the page source and check that the canonical tag shows your domain, not a
.framer.websiteaddress.
Two tags
Check your site's custom code for a pasted canonical tag and remove it.
Source: Framer Help: Set up a custom canonical URL · Framer: WordPress to Framer SEO guide
HubSpot
If you leave it empty: new HubSpot pages use their own address as the canonical, and HubSpot recommends that.
Not set on many pages
- Click the settings icon in the top bar. In the left sidebar, go to Content › Pages.
- Open the SEO & Crawlers tab. Check the Pages and blog posts setting. If it says Don't add canonical URLs to any pages or blog posts, change it.
- Click Save.
One page
- Edit the page and open Settings › Advanced.
- Check the Customize canonical URL field. Leave it empty to use the page's own address. Then Update.
Two tags
Look in the page's Head HTML field and your site header HTML for a pasted canonical tag, and delete it.
Payload or Sanity
Payload
Good to know: Payload's SEO plugin has no canonical field, and Payload's website template adds no canonical tag. Your developer adds it in the site code. On a Next.js site, see the Code tab.
Source: Payload: SEO plugin · Payload website template: generateMeta
Sanity
Good to know: Sanity has no built-in canonical. Your developer adds the tag in the site code. On a Next.js site, see the Code tab.
Check it worked
- Open the page, right-click and choose View page source. Search for
rel="canonical". There should be exactly one, with a fullhttps://address. - Run the Swift Site Audit again. The Canonical URL line should pass.
- In Google Search Console, open URL Inspection and inspect the page. It shows the Google-selected canonical. If Google picked a different address, make sure your menu, your links and your sitemap all use the address you want. Then click Request indexing.
Common mistakes
- A short address like `/services`. Google asks for the full address, starting with
https://. - The tag in the wrong place. Google only accepts it inside
<head>. - Every page pointing to the homepage. Each page should name its own address.
- Pointing at an address that redirects or no longer loads. Point at the final address a visitor lands on.
- Using robots.txt or noindex to pick the main page. Google says not to use robots.txt for this, and doesn't recommend noindex either. Use the canonical tag.
- Linking to the other versions. Google says to link to the main address in your own menus and pages.
Fix it yourself, or have us do it
Related
- Fix a noindex tag: a noindex page loses its canonical tag on many platforms
- Fix robots.txt blocking search engines: the file that controls what Google may crawl
- How to audit your website like a buyer would: why search is the first step of a buyer's visit
Sources
Official documentation only. Each link was opened and read on December 3, 2026.


