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

More in SEO Tools

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

ScenarioExampleCanonical To
URL Parameters?utm_source=newsletterBase 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 HTTPShttp://example.com/pagehttps://example.com/page
WWW vs non-WWWhttps://www.example.comhttps://example.com (or vice versa)
Printer-friendly Pages/article?print=1/article/ main page
Content SyndicationPartner site republishingOriginal source URL
Mobile/AMPm.example.com or AMP pageDesktop 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

MistakeProblemCorrect Approach
Canonical chains (A→B→C)Search engines may get confusedPoint all duplicates directly to final URL
Canonical to 404 pagePage won't be indexedCanonical to existing, relevant page
Using relative URLsMay resolve incorrectlyAlways use absolute URLs
Canonicalizing paginated pages to page 1Deeper pages won't be indexedEach page canonicalizes to itself
Mismatched contentGoogle may ignore canonicalCanonical only to substantially similar content
Multiple canonicals per pageConflicting signalsOne 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

Testing and Verification

After implementing canonical tags:

  1. View page source and verify the tag is present
  2. Use Google Search Console URL Inspection tool
  3. Check the "Indexing" report for canonical warnings
  4. Use third-party SEO audit tools to scan for issues
  5. Monitor search results to ensure correct URLs are indexed

Special Cases

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.