QuoteEDIT: Note that it was caused by PWT SEO, disabling it makes the Canonical URLs correct.
EDIT2: Changing the default setting for 'Self referencing canonical' to 'No', in the configuration for the PWT SEO System plugin, also helps if you like to continue using PWT SEO.
Isn't there anyone else noticing that the 'Force Canonical Category' doesn't work for Canonical URLs. Does it work for you, have it ever worked?
As you might be aware of, there is a field for 'Force Canonical Category' on the product edit screen, right bellow the 'Categories' selection field.
I do expect this to be working for setting a Canonical URL in the source code of the site (since it's named Canonical), to tell Google etc. that it's the same product listed in multiple categories (having the same Canonical URL for all listings), to avoid it being read as a duplicate. But that doesn't seem to be the case now ...?
Let's say I add a product to both 'Sales' and 'Phones' categories, and select 'Phones'
also on 'Force Canonical Category'. Then I visit FE and browses into the 'Sales' category, select to view the product details, and looks at the source code - the Canonical URL is set to the 'Sales' category. Then I browse into the 'Phones' category, select the same product etc., and now the Canonical URL is set to 'Phones' category - so it's changing and not using the selected 'Force Canonical Category', affecting your SEO ratings ...
VM 4.0.2 10661, Joomla! 3.10.10 using vmbeez3
VM Configuration -> SEO SettingsSEO Disabled: Not selected
Use product link suffix: Selected
Seo Suffix: -details
Translate Strings: Selected
Transliterate slugs: Selected
Use Product and Category IDs: Selected
Use full category tree for product links: Selected
Strict mode: Not selected
SEF for cart links: Selected
J! Global Configuration -> SEO SettingsSearch Engine Friendly URLs: Yes
Use URL Rewriting: Yes
Add Suffix to URL: Yes
Unicode Aliases: No
Site Name in Page Titles: After
Just tested on VM3.8.8 and there it is working correctly ... canonical remains the same no matter what category you accessed a product from
and on VirtueMart 4.0.7 10693
https://virtuemartshop.eu/j4/shop/wear/mister/zipper-pullover-detail
https://virtuemartshop.eu/j4/shop/wear/lady/zipper-pullover-detail
canonical remains <link href="https://virtuemartshop.eu/j4/shop/wear/lady/zipper-pullover-detail" rel="canonical">
Using the same configuration as I mentioned above, or something different?
And also tested the same on vmbeez3?
same config... but tested on J4.1.5
I can attach VirtueMart 4.0.7 10693 if u want to try it....
OK, sorry, forgot to mention it's on Joomla 3.10.10
I guess Joomla! 4 is different, and it's long till everyone can make that move ...
I think if it works now on J4 it will work on J3 - your welcome to try but I don't have the time at the moment
Yep, the problem is it doesn't work at the moment for us, in any template - and as fare as I know it never did.
Anyhow no 4.0.7 available, nor any changes to SVN for some time. Have VM gotten into stealth development?
working here J3 VM3.8.8
https://www.stonemania.co.uk/categories/crystals-rocks-minerals/amethyst-crystals-1-detail
you can access it from
https://www.stonemania.co.uk/categories/for-younger-collectors
and
https://www.stonemania.co.uk/categories/crystals-rocks-minerals/rough
<link href="https://www.stonemania.co.uk/categories/crystals-rocks-minerals/amethyst-crystals-1-detail" rel="canonical" />
Noticed they all are products having variants to select, so wonder if that has anything to say also.
Anyhow, something must be different somewhere, in settings or anything else if it works for some, but not others.
You're right, it works - if we disable PWT SEO.
So it seems like it's PWT SEO causing our issues ... ::)
Thanks for pushing me in the right direction!