• Resolved jbaldy

    (@jbaldy)


    Hello,

    since the update of Yoast SEO from 7.1 to 7.8 the schema generated by Site Reviews plugin appears under BreadcrumbList instead of Product.
    During my research about this I found another plugin with similar issue : https://github.com/Yoast/wordpress-seo/issues/10314

    Is there a way to bypass this bug ?

    there is my website with yoast 7.1 : https://www.ambient-it.net/formation/formation-angular/
    there is HTML code with yoast 7.8 and later : https://pastebin.com/S7RYEaU2

    I used google testing tool to find the problem https://search.google.com/structured-data/testing-tool?hl=fr

    [ACTIVE PLUGINS]
    – Add From Server v3.3.3 ………………….. : add-from-server/add-from-server.php
    – Akismet Anti-Spam v4.1 ………………….. : akismet/akismet.php
    – Broken Link Checker v1.11.5 ……………… : broken-link-checker/broken-link-checker.php
    – Child Theme Configurator v2.3.0.4 ………… : child-theme-configurator/child-theme-configurator.php
    – CodeColorer v0.9.16 …………………….. : codecolorer/codecolorer.php
    – Duplicator v1.2.52 ……………………… : duplicator/duplicator.php
    – EWWW Image Optimizer v4.5.0 ……………… : ewww-image-optimizer/ewww-image-optimizer.php
    – iThemes Security v7.2.0 …………………. : better-wp-security/better-wp-security.php
    – Relevanssi v4.1.1.2 …………………….. : relevanssi/relevanssi.php
    – SendGrid v1.11.8 ……………………….. : sendgrid-email-delivery-simplified/wpsendgrid.php
    Site Reviews v2.17.0 ……………………. : site-reviews/site-reviews.php
    Surbma – Yoast SEO Breadcrumb Shortcode v1.0.4 : surbma-yoast-breadcrumb-shortcode/surbma-yoast-breadcrumb-shortcode.php
    – Tawk.to Live Chat v0.3.4 ………………… : tawkto-live-chat/tawkto.php
    – WP-Optimize v2.2.6 ……………………… : wp-optimize/wp-optimize.php
    – WPForms Custom Captcha v1.1.1 ……………. : wpforms-captcha/wpforms-captcha.php
    – WPForms v1.4.9 …………………………. : wpforms/wpforms.php
    – WP Rocket v3.2.2 ……………………….. : wp-rocket/wp-rocket.php
    – WPS Hide Login v1.5 …………………….. : wps-hide-login/wps-hide-login.php
    Yoast SEO v7.1 …………………………. : wordpress-seo/wp-seo.php

    Thank You

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

    (@geminilabs)

    This is happening because the Yoast plugin is using the @id keyword in the Breadcrumb schema. The value of the @id keyword is the URL of the page, this is the same value as the @id of the Product schema that is generated by Site Reviews.

    Essentially, this problem is happening because of Woocommerce…now before you say that you are not using the Woocommerce plugin, please read on:

    The @id keyword allows you to give a node in the JSON-LD schema an URI. This URI identifies the node, allowing you to link multiple schema together. See Node Identifiers in the JSON-LD spec.

    When Woocommerce is installed and in use, it uses the @id keyword in the product schema. The value of @id is the URL of the product page. When you changed the schema type to “Product” in the Site Reviews settings, Site Reviews automatically added the @id keyword (with the URL of the page as the value) in order to automatically link the review schema to any Woocommerce product schema that may exist (since Woocommerce is the most popular e-commerce WordPress plugin, it makes sense to add compatibility for it by default).

    Here is an example of two separate schemas being linked with the @id keyword: (paste the code in https://search.google.com/structured-data/testing-tool to try it out).

    Now, the URL of a product generally stands for two things as far as the schema is concerned:

    1. The product page
    2. The product

    As the product page is the resource being retrieved in the Breadcrumb schema, the @id should get the URI https://www.example.com/product-page. So technically, Yoast is correct in doing this.

    With Woocommerce, the product itself is the resource being retrieved so the @id should ideally get its own fragment https://www.example.com/product-page#product.

    However, since Woocommerce is not adding a fragment to the @id, this conflicts with Yoast which in turn conflicts with Site Reviews (when using the “Product”) schema.

    Now that you understand what is causing the problem and the underlying reason behind it, you have two possible solutions:

    1. Disable Yoast from generating the breadcrumbs in the Yoast settings.
    2. Remove the @id keyword from the Site Reviews schema (since you are not using Woocommerce, I recommend this option):

    /**
     * Removes the @id keyword from the Product schema created by Site Reviews.
     * Paste this in your active theme's functions.php file.
     * @param array $schema 
     * @return array
     */
    add_filter( 'site-reviews/schema/Product', function( $schema ) {
        unset( $schema['@id'] );
        return $schema;
    });
    Thread Starter jbaldy

    (@jbaldy)

    I understand better the issue with Woocommerce

    thank you for your very complete answer, your solution has solved my problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Schema appears under BreadcrumbList in Google Structured Data Tool’ is closed to new replies.