Are you running a website with opencart? Do know about why canonical tag required for your website? Well then, below you can find easy solutions for your requirement.

OpenCart is an open source e-commerce software used to build online stores.Despite its popularity, some of its missing features are glaring, especially when it comes to SEO.  OpenCart does implement the rel=”canonical” tag on its product pages. However, there’s no canonical tag on any of the category pages or the all-important homepage. If you install OpenCart without fixing this problem, a Google site:yourdomain.com search will show a million variations of each category diluting the results, “link juice”, and earning relegation to the “See this search with duplicate pages”.

What Is rel=”canonical” tag and Why should required for website pages.

Read more from https://support.google.com/webmasters/answer/139066?hl=en&rd=1

Find below relatively easy solution,

1) Edit your catalog/controller/product/category.php file

2) Find this line:

if ($category_info) {

3) Immediately after it, add the following lines:

$can_url=$this->url->link(“product/category”,”path=”.$this->request->get[‘path’]); $this->document->addLink($can_url,”canonical”);

4) Now edit catalog/controllers/common/home.php

5) Find this line:

$this->document->setDescription($this->config->get(‘config_meta_description’));

6) Immediately after it add:

$can_url=$this->url->link(‘common/home’); $can_url=str_replace(‘index.php?route=common/home’, ”, $can_url); $this->document->addLink($can_url,’canonical’);

That’s It!!!You have canonical urls!

Related Posts


The Energy Savings Potential of Smart Manufacturing

March 12, 2020

IOT based Energy monitoring system guarantees payback of 8 months ! “IF YOU CAN’T MEASURE IT, YOU CAN’T MANAGE IT” – It became more relevant in today’s context where data-driven decisions are prevalent. The fundamental goal of energy management is to produce goods and provide services with the least cost and least environmental effect. Our […]

Reduce Energy Spend And Optimize Equipment Performance

February 24, 2020

Have you at any point woken in the night in a cold sweat thinking about whether your plant is utilizing more power than it should, putting you off guard when contrasted with your opposition? Regardless of whether your energy checking or energy management system is in operation, you may not have the requisite expertise to […]

Docker – A beginner Tutorial

October 25, 2018

This tutorial will help you to get started with docker. This post is particularly for beginners who are eager to know how to start with amazing docker experience. Let’s Get Started. 1) Install a docker To install and run docker on your machine becomes a really easy thing with getting started guide on docker. You […]