Canonical Tag Generator
Generate canonical markup while reviewing fragments, campaign parameters, HTTPS, and the current-to-preferred URL relationship.
Use the absolute HTTP(S) URL you actually want treated as the preferred representative page.
Supplying the page URL makes self-reference, parameter cleanup, host/protocol changes and cross-domain canonicalization visible.
Canonical markup plus current-page relationship and URL review notes will appear here.
Canonicalization Starts With a Preferred URL, Not With a Tag
Generating the markup is only one part. The harder decision is whether several crawlable URLs are truly duplicate or near-duplicate representations of one page and which URL should represent that set in search.
A canonical tag should reinforce a site's real URL policy: internal links, redirects where appropriate, sitemap entries, HTTPS/hostname conventions and generated page URLs should not all point in different directions.
Self-Referencing Canonicals Are Normal
A page can point to its own clean preferred URL. That does not mean the page is “duplicating itself.” It makes the intended identity explicit and gives templates a consistent rule even when the same content can also be reached through tracking, sorting or other URL variants.
The optional current-page field shows when the generated canonical is self-referencing rather than treating self-reference as a warning.
Query Parameters Are Not Automatically “Non-Canonical”
A parameter can be meaningless campaign tracking, or it can identify a genuinely distinct page. A product configuration, language choice, article state or application route can use a query parameter as part of the preferred URL design.
Familiar campaign/click and session-like parameters are flagged for review without stripping every query string automatically. Canonicalization should follow content identity, not a rule that says “URLs with ? are bad.”
A Fragment Is Removed Before Canonical Output
Fragments such as #installation usually identify a location or client-side state inside a document rather than a separate HTTP resource. Search canonical documentation tells publishers not to use URL fragments for rel=canonical.
The original fragment is recorded before normalization, removed from generated output, and reported separately so the change stays visible.
rel=canonical Is a Signal; a Redirect Changes Navigation
A redirect sends the browser/crawler to another URL. A canonical link tells a search system which equivalent URL you prefer while leaving the current URL directly accessible.
If an old URL has permanently moved and users should no longer access it, a permanent redirect is usually a more direct mechanism. Canonical links are especially appropriate when duplicate variants still need to exist for users or application behavior.
HTML and HTTP Link Canonicals Serve Different Delivery Contexts
HTML pages commonly declare <link rel="canonical" href="…" >in the document head. HTTP's Link response header can express the same registered relation outside HTML and can cover non-HTML resources such as PDFs when the consuming search engine supports it.
Avoid publishing conflicting canonical targets in HTML and HTTP headers. More canonical declarations are not stronger when they disagree.
A Perfect Tag Can Point to a Bad Target
URL-shape checks do not establish the target's live state. A canonical URL can redirect through several hops, return 404, carry noindex, be blocked from crawl, require authentication, or point to substantially different content.
Before a sitewide rollout, sample real pages and verify that their canonical targets are fetchable preferred pages and that the target does not declare a contradictory canonical back elsewhere.
Cross-Domain Canonicals Need Stronger Operational Confidence
Search engines can support canonical references across domains, for example when the same article is legitimately syndicated. That does not make a cross-domain canonical mandatory or guaranteed to be selected.
Confirm that the target is truly the preferred equivalent content, remains stable, and is under an ownership/publishing arrangement you understand. A typo in another domain is much more consequential than a typo in a self-referencing path.
Canonical, Hreflang and Sitemap Signals Should Tell the Same Story
Localized pages using hreflang generally need canonicalization that preserves the intended language/region version rather than collapsing every alternate to one language page. Sitemaps should likewise list the preferred URLs you want discovered.
When canonical tags, redirects, internal links, hreflang sets and sitemap URLs conflict, a search engine has to resolve your contradictory signals. Consistency matters more than generating any one tag perfectly.
