Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Canonical tag in body or multiple canonicals: how to fix it

SEO-047Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

A canonical tag tells search engines which URL is the main version of a page when several URLs show the same content. It looks like <link rel="canonical" href="https://example.com/page/">. Two things can go wrong.

Canonical in the body. Google's documentation says the tag must be in the <head>. A tag that ends up in the <body> is not valid there and is ignored. This often happens when a script, widget or page builder injects markup, or when the head closes early because of broken HTML.

Multiple canonicals. Two or more canonical tags on one page, for example one from your theme and one from an SEO plugin. If they point to the same URL, Google can usually cope. If they differ, Google treats the signals as conflicting and may ignore all of them.

Why it costs you leads or sales

When Google ignores your canonical, it chooses the main URL itself. That can be a parameter URL, a duplicate path or an old version of the page. Ranking signals such as links get split across copies, and the wrong URL may show in results. Visitors then land on a version with different tracking, a worse layout or a missing form. The business impact is usually medium: it rarely removes a page overnight, but it quietly weakens the pages that bring in leads.

How a bad canonical weakens a landing page
  1. Page loadsTwo canonicals, or one in the body
  2. Google reads canonicalSignals conflict or tag is invalid
  3. Google picks its own URLMay be a duplicate or parameter URL
  4. Ranking signals splitLinks spread across copies
  5. Wrong URL gets the visitLead form and tracking may differ

The break happens at the signal step, so every later step works from the wrong URL.

How to check if your site has it

Check the raw HTML, not just what the browser shows after scripts run. Use View Source, not Inspect, to see what Google first receives.

Check one page by hand
  1. Open view-source

    In Chrome, open the page and press Ctrl+U (Cmd+Option+U on Mac), or type view-source: before the URL.

  2. Search for canonical

    Press Ctrl+F and search for rel="canonical". Count the matches.

  3. Check the position

    Make sure each match sits above the closing </head> tag. A match below <body> is in the wrong place.

  4. Compare the URLs

    If there are two or more, note whether the href values are identical.

  5. Confirm in Search Console

    Use URL Inspection on the page and compare the user-declared canonical with the Google-selected canonical.

Count canonical tags from the command linebash
curl -s https://example.com/your-page/ | grep -io '<link[^>]*rel=["'\'']canonical["'\''][^>]*>'

One line of output means one tag. Two or more lines mean duplicates. To check position, look at the raw HTML around the match. For a whole site, a crawler such as Screaming Frog can report pages with multiple canonicals and canonicals found outside the head.

How to fix it

The goal is one source of truth for the canonical. Find every tool that can output one (theme, SEO plugin, page builder, tag manager script, custom code) and leave only one active.

Remove the extra canonical on your platform
  1. Find the sources

    Check which SEO plugin is active (Yoast, Rank Math, All in One SEO). Only one should be. Deactivate the others.

  2. Check the theme

    Search your theme's header.php and functions.php for rel="canonical". Remove a hard-coded tag if your SEO plugin already outputs one.

  3. Remove the default WordPress tag if needed

    WordPress adds its own canonical through rel_canonical. If a custom setup duplicates it, remove it with remove_action('wp_head', 'rel_canonical'); in a child theme or small plugin, only when something else outputs the tag.

Correct: one canonical inside the headhtml
<head>
  <meta charset="utf-8">
  <title>Your page title</title>
  <link rel="canonical" href="https://example.com/your-page/">
</head>
Canonical setup before and after

Broken

  • Theme outputs a canonical to /page/
  • SEO plugin outputs another to /page/?ref=ad
  • A widget adds a third tag in the body
  • Google ignores them and picks its own URL

Fixed

  • One source outputs the canonical
  • Single tag sits inside the head
  • It points to the clean, final https URL
  • Google's chosen canonical matches yours

How to confirm it's fixed

Confirmation checklist
  • View source shows exactly one canonical tag on the page
  • The tag is above </head>
  • The href is an absolute https URL that returns 200 and is the version you want indexed
  • Test a home page, a landing page, a blog post and a product or category page
  • Run URL Inspection in Search Console and request indexing for key pages
  • Re-crawl the site and confirm no pages report multiple canonicals
  • After a few weeks, check that Google-selected canonical matches the declared one

How to prevent it happening again

Prevention checklist
  • Pick one owner for canonicals: theme, plugin or custom code, never several
  • Test after installing or updating an SEO plugin, theme, page builder or app
  • Keep canonical tags out of tag manager scripts and embeds
  • Validate your HTML so the head does not close early
  • Run a scheduled crawl and review the multiple canonicals and outside-head reports
  • Add a canonical check to your release checklist for template changes

How FunnelGuard handles this

FunnelGuard does not check this yet. Looking for duplicate or misplaced canonical tags is a possible future check, not a current feature.

What FunnelGuard does today is run your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons. It checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. If a canonical problem sends visitors to a duplicate URL where a form or tag is broken, a journey check can show that failure, but it will not point to the canonical as the cause.

To watch for this issue yourself, run a crawler such as Screaming Frog on a schedule, review the Page indexing and URL Inspection reports in Google Search Console, and re-check the raw source after every theme or plugin change. FunnelGuard also offers a free read-only website audit, and a Free plan with 1 site and 2 journeys.

Questions people ask

Can a page have two canonical tags?

It can, but it should not. If both point to the same URL, Google can usually cope. If they point to different URLs, Google sees conflicting signals and may ignore both and choose a canonical itself.

Does a canonical tag have to be in the head?

Yes. Google's documentation says rel=canonical must be in the head of the HTML. A canonical placed in the body is invalid there and will be ignored.

Why does my page have multiple canonical tags?

Usually two sources are both active, such as a theme and an SEO plugin, or a plugin and a hard-coded tag. Page builders, apps and tag manager scripts can add another. Find each source and keep one.

How do I find multiple canonical tags on my site?

View the page source and search for rel="canonical", or use curl and grep to count matches. For a whole site, crawl it with a tool such as Screaming Frog and check the reports for multiple canonicals or tags outside the head.

Why is my canonical tag in the body instead of the head?

A script or widget may be injecting it, or invalid markup in the head may make the browser close the head early. Everything after that point, including your canonical, ends up in the body. Fix the markup and the injection source.

Will Google ignore my canonical if there are two?

Google treats a canonical as a hint, and conflicting tags weaken it. With two different URLs, it may ignore both and select its own. Leaving a single tag removes that risk.

How do I remove the duplicate canonical tag in WordPress?

Make sure only one SEO plugin is active, then check header.php and functions.php for a hard-coded tag. If needed, remove the default one with remove_action('wp_head', 'rel_canonical') only when another source outputs it.

Does FunnelGuard detect duplicate canonical tags?

No. FunnelGuard does not check canonical tags yet, though it is a possible future check. It monitors funnels, tracking hits and lead delivery, so use a crawler and Search Console for canonicals.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.