Canonical Tag Generator - Create rel=canonical Links
Generate canonical link tags to specify the preferred version of a page and avoid duplicate content issues.
How to Use
- For a single canonical: enter the page URLs in the first field and the canonical target URL in the second field.
- For batch mode: toggle 'Batch Mode' and enter multiple URLs — each will generate a self-referencing canonical tag.
- Click 'Generate' to create both the HTML <link rel='canonical'> tags and HTTP Link header format.
- Paste the HTML tags inside the <head> section of your page, or configure the HTTP header on your server.
- Use the HTTP Link header format for pages that can't have HTML modified, like PDF files served via HTTP.
About Canonical Tags
What is a Canonical Tag?
A canonical tag (<link rel='canonical' href='URL'>) tells search engines which version of a URL is the 'master' or preferred version when multiple URLs with similar or identical content exist. For example, https://example.com/page, https://example.com/page?ref=twitter, and https://www.example.com/page are technically different URLs but may show the same content. The canonical tag signals to search engines which version should be indexed and receive link equity.
When to Use Canonical Tags
Use canonical tags in these common scenarios: URL parameters creating duplicate content (session IDs, tracking parameters like ?utm_source=), www vs non-www versions, HTTP vs HTTPS versions, trailing slash vs no trailing slash, product pages accessible from multiple category paths, and printer-friendly page versions. Self-referencing canonical tags (a page pointing to itself) are also recommended as a best practice for all pages.
Canonical vs 301 Redirect
Both canonical tags and 301 redirects help consolidate duplicate content, but they serve different purposes. A 301 redirect permanently forwards users and search engines to the target URL — the old URL stops working. A canonical tag allows both URLs to remain accessible while signaling the preferred version for indexing. Use 301 redirects when you want to permanently decommission a URL; use canonical tags when you need to keep multiple URL versions accessible.
HTTP Link Headers for Canonical
For non-HTML resources like PDFs or documents served via HTTP, you can't add HTML canonical tags inside the file. Instead, use an HTTP Link header: Link: <https://example.com/doc.pdf>; rel='canonical'. This achieves the same result as the HTML canonical tag and is fully supported by Google. Configure this via your web server (Apache, Nginx) or CDN settings. This is especially important for canonicalizing document content.
Key Features
- Generates standard <link rel='canonical'> HTML tags
- Also generates HTTP Link header format for non-HTML resources
- Batch mode for generating self-referencing canonicals for multiple URLs
- Supports both single canonical target and one-to-one URL mapping
Common Applications
- Consolidating duplicate product pages created by URL parameter variations
- Setting canonical URLs for paginated content (page 2, 3, etc.) to the first page
- Resolving www vs non-www and HTTP vs HTTPS duplicate content issues
- Adding self-referencing canonicals to all pages as a preventive SEO measure