[Support request] Schema for products

Home Forums Support [Support request] Schema for products

Home Forums Support Schema for products

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #342795
    Ivan

    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?

    #342935
    Tom
    Lead Developer
    Lead Developer

    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/

    #343132
    Ivan

    Thanks Tom, that works! Are there plans to include this in the core?

    #343177
    Tom
    Lead Developer
    Lead Developer

    Yea, I’ve logged it as an issue 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.