Canonical Tag Generator
Build a canonical tag for a preferred page URL.
Result
How to use Canonical Tag Generator
- Enter the values in the order shown in the input label or try the built-in sample.
- Select Run tool to generate the output.
- Review the output before copying it.
How it works
Build a canonical tag for a preferred page URL. Require a full HTTP or HTTPS URL and escape it for an HTML attribute.
Formula or processing rules
Require a full HTTP or HTTPS URL and escape it for an HTML attribute.
Worked example
The sample takes the preferred PDF page URL and outputs a link element with rel set to canonical.
| Measure | Value |
|---|---|
| Preferred page URL | https://example.com/pdf/ |
| Result | <link rel="canonical" href="https://example.com/pdf/"> |
Before using the result
Check that the preferred URL loads and that your internal links and sitemap use the same version. Look for competing canonical tags after publishing.
Pros and cons
Pros
Build a canonical tag for a preferred page URL. The sample provides an immediate check of the expected output.
Cons
Use your intended indexable URL. A tag alone cannot verify redirects or indexing.
Troubleshooting
Check the input format and compare your case with the built-in sample. Use your intended indexable URL. A tag alone cannot verify redirects or indexing.
Common issue and what to check
If the result is rejected, supply a full HTTP or HTTPS URL. Check for an accidental query string or fragment before copying the tag.
Frequently asked questions
How do I use the text I get back?
Copy the output into the document, list, or compatible tool where you need it.
How does the transformation work?
Require a full HTTP or HTTPS URL and escape it for an HTML attribute.
Can I try a sample first?
Yes. Select Try a sample to load the worked example and see the expected result.
What should I check before using the result?
Use your intended indexable URL. A tag alone cannot verify redirects or indexing.
Is my input stored by the tool?
The transformation is computed in the open page. The tool does not save the submitted text.