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
- Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
- Enter rel, href according to the field table, then run the tool.
- Read canonicalRelation, nonemptyHref, passes. Check the effective state, recognized-token flags or generated markup against the rules below.
- Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| rel | Rel | string; maximum text length 100000 | Required |
| href | Href | string; maximum text length 100000 | Required |
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 field | Meaning | Value type |
|---|---|---|
| canonicalRelation | Canonical Relation | boolean |
| nonemptyHref | Nonempty Href | boolean |
| passes | Passes | boolean |
{
"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
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.