• Resolved busterland

    (@busterland)


    Hello,

    I test my product page on structured data on google (https://search.google.com/structured-data/testing-tool/u/0/)
    And I can see that if the short description is filled, the field Product > Description is populated with short description.
    If short descrpition is not filled, the field Product > Description is populated with description.

    In short descritpion field, somethimes there is a video and the description of my product is written on the description field.

    Is it impacting for SEO ?
    If yes, how can I change the value to send to structured to be always the descritpion field ?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support EastOfWest a11n

    (@eastofwest)

    Hi there,

    Using a snippet of code, you can intercept the structured data output by the function generate_product_data, which lives here:

    https://github.com/woocommerce/woocommerce/blob/e97204a483d8a58b29d9e3214eb9024975e0dd58/includes/class-wc-structured-data.php

    By using the filter woocommerce_structured_data_product, you could add a snippet of code (to your functions.php) to force the use of the long description. Here’s an example to get you started:

    
    /* Set structured data to always use long description */
    add_filter('woocommerce_structured_data_product',  'mod_structured_data');
    function mod_structured_data( $structured ) {
        global $product;
        
        $structured['description'] = $product->get_description();
        
        return $structured;
    }
    
    
    Thread Starter busterland

    (@busterland)

    Hello,

    I tried to add the code to my function.php file but it didn’t work.
    The long description doesn’t appear when I check again on the structured data tool…

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change description and short description for structured data google’ is closed to new replies.