Canonical Tag Generator
Generate rel=canonical tags to specify the preferred URL for search engine indexing and prevent duplicate content issues.
Back to all tools on ToolForge
Canonical URL:
Canonical Tag
About Canonical Tag Generator
This canonical tag generator creates the HTML rel="canonical" link element for specifying the preferred version of a page URL. Search engines use canonical tags to consolidate ranking signals and avoid indexing duplicate content.
The generated tag should be placed in the <head> section of your HTML document.
Canonical Tag Syntax
<link rel="canonical" href="https://example.com/preferred-page/"> Placement: Inside the <head> section of your HTML document. Format: Always use absolute URLs (including protocol and domain). Self-referential: Pages should canonicalize to themselves.
When to Use Canonical Tags
| Scenario | Example | Canonical To |
|---|---|---|
| URL Parameters | ?utm_source=newsletter | Base URL without parameters |
| E-commerce Filters | /shirts?color=red&size=m | /shirts/ category page |
| Pagination | /blog/page/2/, /blog/page/3/ | Each page to itself (or view-all) |
| HTTP vs HTTPS | http://example.com/page | https://example.com/page |
| WWW vs non-WWW | https://www.example.com | https://example.com (or vice versa) |
| Printer-friendly Pages | /article?print=1 | /article/ main page |
| Content Syndication | Partner site republishing | Original source URL |
| Mobile/AMP | m.example.com or AMP page | Desktop standard HTML version |
Complete HTML Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Page - Example Store</title>
<!-- Canonical tag -->
<link rel="canonical" href="https://example.com/products/blue-widget">
<!-- Other meta tags -->
<meta name="description" content="Buy the blue widget...">
<meta property="og:url" content="https://example.com/products/blue-widget">
</head>
<body>
<h1>Blue Widget</h1>
...
</body>
</html>
Common Canonical Mistakes to Avoid
| Mistake | Problem | Correct Approach |
|---|---|---|
| Canonical chains (A→B→C) | Search engines may get confused | Point all duplicates directly to final URL |
| Canonical to 404 page | Page won't be indexed | Canonical to existing, relevant page |
| Using relative URLs | May resolve incorrectly | Always use absolute URLs |
| Canonicalizing paginated pages to page 1 | Deeper pages won't be indexed | Each page canonicalizes to itself |
| Mismatched content | Google may ignore canonical | Canonical only to substantially similar content |
| Multiple canonicals per page | Conflicting signals | One canonical per page only |
Canonical Tags vs 301 Redirects
Use 301 Redirect when:
- Page has permanently moved
- Old URL should NOT be accessible
- You want users AND search engines to see new URL
- Example: /old-product/ → /new-product/
Use Canonical Tag when:
- Duplicate content must remain accessible
- Different URLs serve same content intentionally
- You only need to guide search engines
- Example: /product?color=red and /product?color=blue
both canonicalize to /product/
Implementation Checklist
- Use absolute URLs: Include https:// and full domain
- Place in head: Canonical must be in the
<head>section - Self-referential canonicals: Every page should have a canonical pointing to itself
- Consistent with hreflang: If using hreflang, canonical should match
- Update on URL changes: When URLs change, update canonicals accordingly
- Verify in Search Console: Check Google Search Console for canonical issues
- Avoid canonical chains: Point all duplicates directly to the preferred URL
Testing and Verification
After implementing canonical tags:
- View page source and verify the tag is present
- Use Google Search Console URL Inspection tool
- Check the "Indexing" report for canonical warnings
- Use third-party SEO audit tools to scan for issues
- Monitor search results to ensure correct URLs are indexed
Special Cases
- Cross-domain canonicals: Point to canonical URL on different domain for syndicated content
- Canonical + hreflang: Each language version canonicalizes to itself, hreflang connects translations
- Canonical in HTTP headers: For non-HTML files (PDFs), use
Link: <url>; rel="canonical"header - AMP canonicals: AMP pages point to standard HTML; HTML page references AMP via
rel="amphtml"
Frequently Asked Questions
- What is a canonical tag and why is it important for SEO?
- A canonical tag (rel=canonical) tells search engines which URL is the preferred version when duplicate or similar content exists. This prevents duplicate content issues, consolidates ranking signals to one URL, and ensures the correct page appears in search results. Essential for e-commerce filters, pagination, and parameterized URLs.
- When should I use canonical tags?
- Use canonical tags when: you have printer-friendly versions of pages, URLs with tracking parameters create duplicates, e-commerce filters generate multiple URLs for same products, content is syndicated across domains, or you have HTTP/HTTPS or WWW/non-WWW duplicates.
- What is the correct canonical tag format?
- Place in the HTML head section: . Use absolute URLs (not relative paths). The canonical should point to itself (self-referential) or to the master version of duplicate content.
- Can canonical tags hurt SEO if used incorrectly?
- Yes. Common mistakes: canonicalizing all paginated pages to page 1 (loses indexation of deeper pages), pointing canonicals to non-existent URLs, creating canonical chains (A→B→C), or canonicalizing to a completely different page. Google may ignore incorrect canonicals.
- What is the difference between canonical tags and 301 redirects?
- 301 redirects permanently send users and search engines from one URL to another (the old URL becomes inaccessible). Canonical tags keep both URLs accessible but tell search engines which one to index. Use 301 for permanently moved content, canonical for duplicate content that must remain accessible.
- How do I handle canonical tags for mobile or AMP pages?
- Mobile pages should canonicalize to the desktop version. AMP pages should have a canonical pointing to the standard HTML version. The desktop version should NOT canonicalize to mobile/AMP. This bidirectional relationship helps Google understand the connection between versions.