• Resolved adil1641

    (@adil1641)


    hi, i am facing the issue in web console named as “Either “offers”, “review”, or “aggregateRating” should be specified error”. what should i do to fix this. please guide me. I have google it and found this one
    /**
    * Remove the generated product schema markup from Product Category and Shop pages.
    */
    function wc_remove_product_schema_product_archive() {
    remove_action( ‘woocommerce_shop_loop’, array( WC()->structured_data, ‘generate_product_data’ ), 10, 0 );
    }
    add_action( ‘woocommerce_init’, ‘wc_remove_product_schema_product_archive’ );

    I have added this in functions.php.
    is there any suggestion about this. Is this right way to fix this or i need another technique to fix this.

    please guide me so that i will fix this as soon as possible.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter adil1641

    (@adil1641)

    hi, i did not receive any respond from author about this issue. please guide me currently 450 errors are showing of this issue.
    please suggest me so that i will fix them.

    Schema is included by default in WC. You probably have a SEO plugin that is overriding WC’s. You need to shut that one off.

    Thread Starter adil1641

    (@adil1641)

    I am using yoast seo plugin.

    Maybe look at Yoast for guidance on this first. They also offer a WooCommerce plugin listed at the top of this page.
    https://kb.yoast.com/kb/configuration-guide-for-yoast-woocommerce-seo/

    I’d suggest shutting off Schema for Yoast in general but if you do and you’re also running a blog and pages it might hurt those.

    For that if you’re running Yoast 11+ you shut it off by using

    add_filter( 'wpseo_json_ld_output', '__return_false' );
    

    Yoast earlier than 11

    function disable_yoast_schema_data($data){
    	$data = array();
    	return $data;
    }
    add_filter('wpseo_json_ld_output', 'disable_yoast_schema_data', 10, 1);
    Thread Starter adil1641

    (@adil1641)

    i am using 9.7 version. this issue is occuring in products.
    by applying this filter, blog and pages will hurt or not?

    Not in the immediate. Only long run. This is for testing purposes only. Yoast will also add to that or conflict with it. You can shut it off as I’ve stated and then test your Schema to see how it’s pulling.

    Thread Starter adil1641

    (@adil1641)

    actually i validate after adding above code in functions.php. so it takes 2-3 days to crawl again. if again these errors will occur, then i will add yoast seo filter code to remove this issue.

    You test validation by using Structure Data tool

    https://search.google.com/structured-data/testing-tool/u/0/

    Thread Starter adil1641

    (@adil1641)

    which link should be given in this tool. because when i paste the home page url on this tool, then no error or no warnings are shown

    You can do either or. You can add your Schema or URL. Doesn’t matter.

    dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hey @adil1641

    Missing aggregateRating/ratings is a warning. If your product doesn’t have reviews, of course this data is missing. WooCommerce cannot make up review content for you

    From https://github.com/woocommerce/woocommerce/issues/22896#issuecomment-477074896

    I’m going to close this for now as all details are available on that GitHub link and this isn’t purely WooCommerce core.

    Thanks,

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Either “offers”, “review”, or “aggregateRating” should be specified error’ is closed to new replies.