How To Use Canonical Tags To Improve Website SEO

HTML Brackets

Does your website have issues with duplicate content and ranking in search engines? If so, you may need canonical tags to boost rankings for specific URLs.

What are canonical tags?

Canonical tags are a piece of html code that one can use when you have multiple urls that link to the same content. Duplicate content can be problematic in search engines because they can rank your urls against each other, thereby lowering your overall ranking. Sometimes, search engines will pick a url on your behalf if it determines that there is duplicate content; however, it is best that you as a website owner or developer choose the url you would like to rank in search engines in order to:

  1. Simplify metrics for that page
  2. Guide users as to what links they should click on
  3. Consolidate the ranking of many urls into a single url

Duplicate content is often prevalent in e-commerce stores that provide various options for products such as size or color. It can also show up if you have extra parameters that are used for tracking.

Check out the examples below. ← You only want to rank for this url ← Tag this as canonical ← Tag this as canonical

How to insert canonical tags into your web pages?


You can insert canonical tags into the <head> section of an HTML page.

Let’s say I have the following urls:

In the <head> of page, insert a <link> with rel=”canonical” as shown below.

<!DOCTYPE html>
<html lang="en">
    <title>My Page With Parameters</title>
    <link rel="canonical" href="">

Non-HTML Pages – Images, PDFs, and More

PDFs, images, and other non-html pages on the web don’t have a <head> section so you’ll need to add the canonical tag to the HTTP headers. You can do this by updating .htaccess file.

<Files "mydocument.pdf">
Header add Link '<>; rel="canonical"'

You also have the option of updating your urls dynamically.

Options +FollowSymLinks
RewriteEngine On
RewriteRule ([^/]+)\.jpg$ - [E=FILENAME:$1]
<FilesMatch "\.pdf$">
    Header add Link '<{FILENAME}e.html>; rel="canonical"'

Other Options for Canonicalizing Urls

301 Redirects

A 301 redirect sends users from one URL to another URL. If a user clicks on a link with a 301 redirect, they will immediately be directed to the new page. Usually, there are two factors that account for rank in search engines: the number of inbound links and the domain authority of websites that link to a page. A link from a reputable website can have a greater impact on your page rank than a link from a non-reputable website. However, even if you are linking to another page on the same site, it still helps search engines understand which URL you prefer and will also take the ranking of your original page into account. Hence, do not delete old pages with similar content on your site. Keep them live and redirect to your newer or preferred page.


If you’re not too keen on digging into HTML, you can use plugins to insert canonical urls. Here’s an example using Yoast SEO:


Canonical tags are a small, but important detail for website SEO. Help users find your most relevant content by taking the time to tag it accordingly.

How To Use Canonical Tags To Improve Website SEO
Notify of
Inline Feedbacks
View all comments
Scroll to top
Would love your thoughts, please comment.x