Opencart has a lot of duplicate content, and adding canonical urls can be a great option to improve your SEO. However Opencart doesn't make this easy by default, so we will have to make some changes, or use the FREE VQMOD to add them in and avoid the dreaded Google Panda penalty!
So by default, the homepage breadcrumb in Opencart points to this url:
Now this isn’t ideal from an SEO perspective, as we want all of the internal links to point to our proper root domain url, which would be:
So to do this, We have to edit the seo_url.php file, which is found here: /catalog/controller/common/seo_url.php
Find the line:
And before it, add this line:
$link = str_replace('index.php?route=common/home', '', $link);
This will fix all of the homepage breadcrumbs to point to the proper root domain url.
Change The Opencart Homepage Breadcrumb Link Text
Sometimes we might want to link with some text that’s a little more SEO friendly than just “home”, or maybe your shop is on a sub-domain or sub-directory and you want to label it with a different name.
So to edit this homepage breadcrumb link, edit the file header.php, in /catalog/language/english/common/header.php
You need to edit the line:
$_['text_home'] = 'Home';
Replacing the word “Home” with the text you want to link to the homepage with. In our example we’ve changed it to this:
$_['text_home'] = 'Digital Products';
If you have any questions about this, then feel free to leave them in the comments. Share the guide with your friends if you enjoyed it!
Digital marketer, specialising in e-commerce SEO, including audits and strategy. Director of JP Digital Enterprises.
Latest posts by Matt Jackson (see all)
- Edit The Opencart Homepage Breadcrumb - April 16, 2017
- Opencart Canonicals & Duplicate Content - April 9, 2017
- How to enable basic SEO settings in Opencart for Free - April 9, 2017