Canonical link rel Check

Checks the canonical relation and a nonempty parsed href. Relative href values are accepted; this does not establish URL validity or canonical selection by search engines.

Description

A canonical link identifies a preferred representation among related resources.

A canonical link identifies a preferred representation among related resources. Local presence of its relation and href is separate from canonical selection by a crawler.1

The tool returns canonicalRelation, nonemptyHref, passes. The fields describe the supplied local pattern or effective state, or contain the formatted markup shown below.

When to use Canonical link rel Check

Use this for the following task: Checks the canonical relation and a nonempty parsed href. Relative href values are accepted; this does not establish URL validity or canonical selection by search engines. Provide the requested local fields extracted from the relevant element or attribute.

How to use Canonical link rel Check and understand its results

  1. Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
  2. Enter rel, href according to the field table, then run the tool.
  3. Read canonicalRelation, nonemptyHref, passes. Check the effective state, recognized-token flags or generated markup against the rules below.
  4. Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
Input fieldMeaningValue type and boundsRequirement
relRelstring; maximum text length 100000Required
hrefHrefstring; maximum text length 100000Required

Supply parsed rel and href values. Fold case on whitespace-separated relation tokens and independently check nonempty href content.

passes = rel contains canonical AND href has an HTML-whitespace token

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
canonicalRelationCanonical Relationboolean
nonemptyHrefNonempty Hrefboolean
passesPassesboolean
json
{
  "input": {
    "rel": "canonical",
    "href": "/articles/main"
  },
  "output": {
    "canonicalRelation": true,
    "nonemptyHref": true,
    "passes": true
  }
}

Limitations and assumptions

Relative href values are accepted. No URL parsing, destination fetching, equivalence testing or search-engine canonical selection occurs.

The tool does not fetch a page, run a browser or validate an entire HTML document. Malformed tool requests produce input errors; valid requests can still report unrecognized values or failed local checks.

Alternative or Complementary methods

Choose hreflang Alternate Language Pairs when you need its operation: Checks supplied hreflang/href pairs for nonempty values and repeated language labels ignoring ASCII case. It does not validate BCP 47 registry membership, URL syntax, reciprocal links or search-engine selection. Choose Robots Meta Content Values Lookup for the complementary operation: Resolves Google Search robots index and follow directives, including all/none and restrictive conflicts. Reports recognized boolean directives and unhandled tokens; parameterized directives are outside this profile.

Background reference: HTML Standard: Canonical link rel Check.

References

  1. HTML Standard: Canonical link rel Check — WHATWG

Similar or alternative tools

  • hreflang Alternate Language Pairs

    Checks supplied hreflang/href pairs for nonempty values and repeated language labels ignoring ASCII case. It does not validate BCP 47 registry membership, URL syntax, reciprocal links or search-engine selection.

  • Robots Meta Content Values Lookup

    Resolves Google Search robots index and follow directives, including all/none and restrictive conflicts. Reports recognized boolean directives and unhandled tokens; parameterized directives are outside this profile.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies