Breadcrumb Brand Schema.org
-
Hi, I have a problem with breadcrumbs in the Brand attributes section (frontend).
I have enabled the archives for brand, so my url is:
https://domain.it/brand/brandname
When I click on a brand logo I enter https://domain.it/brand/brandname correctly but the breadcrumbs for brand have this slug: Home/prodotto brand/brandname, this is not good for my SEO optimization.
I need the breadcrumbs to be exactly as in the url and the word “prodotto brand” replaced with “brand” (I think “prodotto” because the theme is translated in italian, in english “product brand”)
Also, I checked the structured data and this problem shows up there as well. I paste the code with problem in the Private Content.
I need to go live on Monday, please, how can I fix it?
Thank you
Hello,
The breadcrumbs are the Woocommerce functionality, WoodMart does not inluence.
Please try to install the free YOAST SEO plugin, it has options to configure the breadcrumbs.
Best Regards
Thank you,
I solved it with some code in function.php, I paste it here in case anyone might need it:
function er_woocommerce_get_breadcrumbs($crumbs, $breadcrumb) {
foreach ($crumbs as &$crumb) {
$brand = false;
foreach ($crumb as &$v) {
if (substr($v, 0, 9) === “Prodotto “) {
// case index = 0
$brand = true;
$v = substr($v, 9);
}
if (strlen($v) === 0) {
// case index = 1
$brand = false;
$v = “/brand”;
}
}
}
return $crumbs;
}
add_filter(‘woocommerce_get_breadcrumb’, ‘er_woocommerce_get_breadcrumbs’, 9999, 2);
Hello,
Thank you very much for sharing the code.
I am sure it would be useful for other site owners.
Wish you a wonderful day!
The topic ‘Breadcrumb Brand Schema.org’ is closed to new replies.