News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Canonical issues on Product page

Started by Trimud, October 13, 2019, 21:27:14 PM

Previous topic - Next topic

Trimud

Hello,

I have the following issue with Joomla 3.9.12, Virtuemart 3.6.2, PHP 7.2

I want to have canonical link in products page. Normally this should work out of the box but it's not.
I saw that this piece of code in components/com_virtuemart/views/productdetails/view.html.php doesn't work:
$canonical_link = JUri::getInstance()->toString(array('scheme', 'host', 'port')).JRoute::_($product->canonical);

If I change it to use http instead of https or add any other link the canonical link tag is loaded on the page.

The problem I'm trying to solve is the following:
- I have disabled 'Use full category tree for product links' in Virtuemart SEO config
- Now I can access the product from two URLs:
    - site/proudct-url
    - site/product-category/product-url

This will lead to duplicated content being indexed by Google so I want to handle this using rel="canonical"

Any help will be appreciated!
Thank you

jenkinhill

VirtueMart already adds canonical URLs. eg this is from demo.virtuemart.net:
<link href="http://demo.virtuemart.net/zipper-pullover-detail" rel="canonical" />
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Trimud

Thank you Kelvyn,

I'm aware that it works on demo site but not on this site: https://growshop-bg.com/en/eazy-plug-24

As you can see there is no canonical tag found in source code for this page. It also doesn't matter if I set canonical category for this or any other product.

AH

change to another template - beez - then test

Your template is probably at fault here
Regards
A

Joomla 4.4.5
php 8.1

Trimud

Thanks, I can confirm this is working.
Looks like the issue is with T3 blank template.

Ventsi Genchev

Is your site multilingual?

Are there any tags:
rel="alternate"
hreflang="x-default"

Are you sure Google indexes the product in other categories?

I'm not convinced that if a site is multilingual it should have a canonical tag.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Trimud

Hello,

I have disabled rel="alternate" based on request by the client and SEO company confirming this won't be an issue...

Canonical is working if I switch to beez3 template, so any help in understanding why it is not working with T3 Blank will be appreciated.

Thanks in advance

Ventsi Genchev

Quote from: Trimud on October 20, 2019, 22:06:10 PM
Canonical is working if I switch to beez3 template, so any help in understanding why it is not working with T3 Blank will be appreciated.

In my opinion, the problem is not in the template, but in the language module. It is not set up correctly or changes have been made, which is why this problem occurs.
When switching to another template, the language module does not load because there is no such module position. Accordingly, the canonical tag then appears.

Quote from: Trimud on October 20, 2019, 22:06:10 PM
I have disabled rel="alternate" based on request by the client and SEO company confirming this won't be an issue...

I do not agree with this. Install the Hreflang Tag Checker add-on in Chrome.
https://growshop-bg.com/en/contacts - missing x-defaults
https://growshop-bg.com/contact-us - x-defaults and English link are missing
So are things with products.

The topic of the tags is very broad. There are many good explanations in moz.com.
https://moz.com/community/q/rel-canonical-and-rel-alternate-both-necessary
https://moz.com/blog/rel-canonical

I also do not use the full category path to the product and have no canonical tag in the product. But if it is written in the URL site/category/product, then a canonical tag also appears (site/product). But this is only if you introduce the URL manually. Google does not index such links.
For your site, too, I do not see Google indexing such links (site/category/product).
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Trimud

I can confirm that loading default language switcher module the canonical tag is loaded.
I am using this module as it helps with proper redirect to correct product in the other language: https://shop.st42.fr/en/products/multi-language-for-virtuemart.htm
I'll check the code and see if I can find something related to canonical.

I have the same opinion about href tags, but most users in Bulgaria have their browsers installed with English language. This means that they were seeing search results for the site in english and rival websites are showing results in Bulgarian...

Thanks for your input Ventsi, much appreciated!

Trimud

I can also confirm that if I disable hreflang config in this module the canonical is working properly: https://prnt.sc/pn6yv5