Overview
Introduction
A canonical tag tells search engines which URL is the "real" one when the same content is reachable through more than one URL - through tracking parameters, trailing slashes, or session IDs - but a duplicated or relative canonical tag can quietly undermine the whole point of having one.
This tool fetches a page (or reads pasted HTML) and checks both problems: whether more than one canonical tag exists in the raw source, and whether the canonical URL found is absolute as Google recommends.
What Is Canonical URL Checker?
A canonical tag auditor that counts <link rel="canonical"> occurrences in a page's raw HTML and reads the canonical URL to check whether it's absolute or relative.
It works two ways: fetching a URL directly when the target allows cross-origin requests, or reading HTML you paste in, which works regardless of CORS.
How Canonical URL Checker Works
Canonical tags are counted with a regex over the raw HTML text rather than the parsed DOM, since browsers can deduplicate repeated tags differently and hide a second occurrence from a DOM-based read.
The canonical URL itself is checked for a scheme (http:// or https://) and flagged as relative if it starts with / or has no scheme at all.
When To Use Canonical URL Checker
After a CMS or plugin update, to catch a canonical tag that got accidentally duplicated by a template change or a new SEO plugin.
While auditing a site migration, since relative canonical URLs are a common leftover from copying templates between environments.
Often used alongside Meta Tag Checker and Hreflang Tag Checker.
Features
Advantages
- Counts raw HTML occurrences with a regex, catching duplicates that a browser's DOM parser might silently hide through its own deduplication behavior.
- Flags relative canonical URLs specifically, a subtle issue that looks fine in a browser but goes against Google's explicit recommendation.
- Works on any page via the paste-source fallback, not just pages with permissive CORS.
Limitations
- This tool checks tag count and URL shape only; it doesn't verify the canonical URL actually resolves to a real, accessible page, or that it matches the page's own content.
- A live fetch only works when the target sends permissive CORS headers, which most ordinary websites don't; use the paste fallback for anything else.
Examples
Best Practices & Notes
Best Practices
- Always write the canonical href as a full absolute URL, including the https:// scheme and host.
- Check for duplicate canonical tags whenever you add a new SEO plugin, since plugin-injected and hardcoded template canonicals are the most common source of duplicates.
Developer Notes
The duplicate check is intentionally regex-based over raw HTML rather than DOM-based, since `document.querySelectorAll('link[rel="canonical"]')` behavior around duplicate elements isn't consistently specified across browsers; see the parseHtmlDocument helper's `canonical` field for the DOM-based single value used for the URL itself.
Canonical URL Checker Use Cases
- Verifying a page's canonical tag is correct and singular after a CMS or plugin change
- Catching a relative canonical URL left over from a staging-to-production migration
- Auditing pages that are reachable through tracking parameters to confirm they all canonicalize to the same clean URL
Common Mistakes
- Adding an SEO plugin's canonical tag without removing a hardcoded one already present in the page template, resulting in two conflicting tags.
- Writing the canonical href as a relative path copied directly from the page's own <a> links instead of a full absolute URL.
Tips
- If a page can be reached through multiple URL variants (http/https, www/non-www, trailing slash), pick one form and make sure the canonical always points to that exact form.