About canonical url generator
A canonical tag tells search engines which address is the preferred version of a page when similar content exists at several URLs, for example with tracking parameters or both www and non-www versions.
How to write it
- Use the full absolute URL, including https.
- Point to the clean version without session IDs or tracking parameters.
- Place it in the head of the page.
- Use one canonical per page, and make it point to a page that returns a normal 200 status.
A hint, not a command
Search engines treat the canonical tag as a strong hint. They may choose a different URL if signals such as redirects and internal links disagree with it.
A worked example
The same page might be reachable as http://example.com/shoes, https://www.example.com/shoes?ref=ad and https://example.com/shoes/. A canonical tag on each pointing to https://example.com/shoes tells search engines to treat them as one page and combine their signals.
Rules to follow
- Use one canonical URL per page, in the head section.
- Make it self-referencing on the preferred version.
- Do not point canonicals to pages that redirect or are blocked.
