Viewing 1 replies (of 1 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    If you choose “Product” as the Site Reviews schema type, Site Reviews will add an @id property to the schema that matches the @id property in the Woocommerce schema which looks something like this:

    https://website.com/product/slug/#product
    

    However, RankMaths uses an @id property which looks like this:

    https://website.com/product/slug/#richSnippet
    

    As you can see, these @id properties do not match which is why the Site Reviews schema does not link with the RankMaths schema.

    If you are unable to change the RankMaths @id property, then you can change the Site Reviews @id property instead to match RankMaths one using the schema hook that Site Reviews provides (see the “Site Reviews > Help > Hooks page).

    For example:

    /**
     * Modify the properties of the Site Reviews Product schema
     * Paste this in your active theme's functions.php file.
     * @param array $schema
     * @return array
     */
    add_filter('site-reviews/schema/Product', function ($schema) {
        if (!empty($schema['@id'])) {
            $schema['@id'] = str_replace('#product', '#richSnippet', $schema['@id']);
        }
        return $schema;
    });
Viewing 1 replies (of 1 total)
  • The topic ‘Site Reviews for WooCommerce Products with RankMaths SEO’ is closed to new replies.