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.

https://kritashi.com/shirt ← You only want to rank for this url
https://kritashi.com/shirt?color=red&size=medium ← Tag this as canonical
https://kritashi.com/shirt?gclid=test123 ← Tag this as canonical

How to insert canonical tags into your web pages?

HTML Page

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

Let’s say I have the following urls:

https://kritashi.com/mypage
https://kritashi.com/mypage?myparameter=value1

In the <head> of page https://kritashi.com/mypage?myparameter=value1, insert a <link> with rel=”canonical” as shown below.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>My Page With Parameters</title>
    <link rel="canonical" href="https://kritashi.com/mypage">
</head>
<body>
    
</body>
</html>

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 '<https://kritashi.com/mypage>; rel="canonical"'
</Files>

You also have the option of updating your urls dynamically.

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

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.

Plugins

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:

Conclusion

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
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Scroll to top
0
Would love your thoughts, please comment.x
()
x