+254725682556 +254725052660 info@ziprof.co.ke
Client Area

SEO

What Is a Canonical Tag and Why Does It Matter for SEO?

A canonical tag is a small piece of HTML code that tells search engines which version of a page is the "master" copy when two or more URLs on your site show the same or very similar content. Without one, Google may split ranking signals between duplicate pages, or show the wrong version of a page in search results.

Why duplicate content happens

Most websites end up with duplicate content by accident rather than on purpose. Common causes include:

  • The same page being reachable at both https://yoursite.co.ke and https://www.yoursite.co.ke
  • Tracking parameters added to a link, such as ?utm_source=facebook, which creates a technically "different" URL for the same page
  • Product or blog pages that appear under more than one category, each with its own URL
  • Filtered or sorted versions of a page (for example, sorted by price) that show the same content as the main page
A canonical tag is different from a redirect. A redirect sends visitors and search engines to a new URL. A canonical tag lets both URLs stay live for visitors, but tells search engines which one to index and rank.

What a canonical tag looks like

A canonical tag sits inside the <head> section of a page's HTML and looks like this:

<link rel="canonical" href="https://yoursite.co.ke/main-page/" />

Every page on your site should have a canonical tag, even if it simply points to itself. This is called a "self-referencing" canonical tag, and it's considered good practice for every unique page on a site.

How to add a canonical tag

If your site runs on WordPress

Most WordPress sites manage canonical tags through an SEO plugin rather than by editing code directly.

  1. Open the page or post you want to set a canonical URL for in the WordPress editor.
  2. Scroll down to your SEO plugin's settings panel, commonly labeled Yoast SEO or Rank Math.
  3. Look for an Advanced tab within that panel.
  4. Find the field labeled Canonical URL and paste in the full URL of the page you want treated as the original.
  5. Click Update or Publish to save the page.

If you leave this field blank, most SEO plugins automatically insert a self-referencing canonical tag for you, which is correct for the majority of pages.

If your site is custom-built (not WordPress)

Add the canonical link tag directly inside the <head> section of the page's HTML template, using the full, correct URL of the preferred version of the page. If your site is generated from a template or CMS, check whether the templating system already inserts one automatically before adding your own: having two conflicting canonical tags on the same page can confuse search engines rather than help them.

Checking a canonical tag is working

  1. Open the page in your browser.
  2. Right-click anywhere on the page and choose View Page Source (or press Ctrl+U on Windows, Cmd+Option+U on Mac).
  3. Search the page (Ctrl+F or Cmd+F) for the word canonical to find the tag and confirm it points to the correct URL.
Never point a page's canonical tag to a completely different, unrelated page. This tells search engines to stop indexing the original page entirely, which can remove it from search results.

If your goal is to keep a specific page out of search results altogether, rather than just merging duplicate versions of the same content, a noindex tag is the right tool to use instead of a canonical tag.