Archived topic
Schema for products
3 replies · Started by Ivan on July 2, 2017
Sorry if this has already been discussed but I tried a search and came up with nothing relevant.
I'll admit that I'm not an expert on schema.org markup but shouldn't we be using a "product" type on Woocommerce product pages? Right now, we use <body itemtype="//schema.org/WebPage"> for pages but we use <body itemtype="//schema.org/Blog"> for blog posts as well as Woocommerce products.
I think product pages should be marked up as <body itemtype="//schema.org/Product">, shouldn't they?
Yea, you're likely right.
Try this:
add_filter( 'generate_body_itemtype', 'tu_woocommerce_itemtype' );
function tu_woocommerce_itemtype() {
return 'Product';
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Thanks Tom, that works! Are there plans to include this in the core?
Yea, I've logged it as an issue :)