The canonical tag (`<link rel=”canonical” href=”…”>`) is a powerful tool for managing duplicate content, but it requires precise syntax to be understood by search engines. An invalid attribute in a canonical annotation is a common technical error where the link tag contains incorrect or superfluous attributes. This can cause search engines to ignore the canonical signal entirely, leaving your site vulnerable to the duplicate content issues you were trying to solve.

Think of a canonical tag as a formal declaration. It has a strict format that must be followed. Adding extra, non-standard information to the declaration can render the whole statement invalid. For a broader look at canonicalization, see our main guide on canonical issues.

An illustration of a broken link tag, symbolizing an invalid attribute in a canonical annotation.

The Correct Syntax for a Canonical Tag

A valid canonical tag is a `<link>` element placed in the `<head>` of the HTML. It has only two required attributes:

  • `rel=”canonical”`: This specifies the relationship of the tag.
  • `href=”[absolute-url]”`: This specifies the full, absolute URL of the canonical page.

Any other attribute is invalid and should be removed. For a deep dive into the technical requirements, this guide from Moz on canonicalization is an excellent resource.

Common Mistakes to Avoid

Invalid ExampleReason
`<link rel=”canonical” name=”canonical-url” href=”…”>`The `name` attribute is not a valid attribute for a canonical link tag.
`<link rel=”canonical” id=”canonical” href=”…”>`The `id` attribute is not a valid attribute for a canonical link tag.
`<link rel=”canonical” href=”page-b.html”>`The `href` attribute must contain a full, absolute URL, not a relative one.

How to Find and Fix Invalid Canonical Attributes

Fixing this issue is a straightforward process of identifying and cleaning up the incorrect tags. For Google’s perspective on this, their guide on consolidating duplicate URLs is a must-read.

  1. Crawl Your Site: Use an SEO audit tool like Creeper to perform a full crawl. The tool will parse the HTML of every page and can be configured to flag canonical tags with incorrect attributes.
  2. Identify the Invalid Tags: Review the crawl report to find all pages that have canonical tags with superfluous or incorrect attributes.
  3. Correct the HTML: Access the source code or CMS template for the affected pages and remove the invalid attributes from the `<link>` tag, ensuring only `rel` and `href` remain.
  4. Validate the Fix: After deploying the changes, recrawl the affected URLs to confirm that the canonical tags are now correctly formatted.

Frequently Asked Questions

What are the only valid attributes for a canonical tag?

A valid canonical link tag has only two attributes: `rel=”canonical”` and `href=”[URL]”`. Any other attributes, such as `name` or `id`, are invalid and can cause the tag to be ignored.

Can I have more than one canonical tag on a page?

No. A page must have one and only one canonical URL declared. Having multiple canonical tags creates a conflicting signal that will cause search engines to ignore all of them.

How can I check my canonical tags for invalid attributes?

The most effective way is to use a website crawler like Creeper. It will scan your site and specifically check the syntax of your canonical tags, flagging any that contain invalid attributes or other formatting errors.

Are your canonical signals being heard? Start your Creeper audit today to find and fix any invalid attributes in your canonical tags.