Title: Change schema json code for Product.
Last modified: December 25, 2019

---

# Change schema json code for Product.

 *  Resolved [Milan.Nikolic](https://wordpress.org/support/users/milannikolic/)
 * (@milannikolic)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/change-schema-json-code-for-product/)
 * Hi,
 * I was wondering, is there any option where I can change the schema JSON code 
   for schema.org/Product? I am trying to change something in “offers” property 
   on Product item. I was wondering how can I alter this in my theme?
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/change-schema-json-code-for-product/#post-12269774)
 * There is a filter called “[woocommerce_structured_data_product_offer](https://docs.woocommerce.com/wc-apidocs/source-class-WC_Structured_Data.html#269)”
   that might do the trick for you if used in your child theme’s functions.php. 
   It looks like it passes the $markup_offer as an array as well as the $product
   object. You could add a function to alter $markup_offer and return the changed
   values.
 * I haven’t tested this, but I think you’d do something like this if the product
   ID you wanted to change was 5:
 *     ```
       function fix_my_product_offers_schema ($markup_offer, $product) {
         if ($product->get_id() == 5) {
           // make your changes to the offers markup here
         }
         return $markup_offer;
       }
       add_filter('woocommerce_structured_data_product_offer', 'fix_my_product_offers_schema', 10, 2);
       ```
   
 * You could alter the conditional if you have more than one product to change, 
   or leave it out if you want to change all products.
 *  Thread Starter [Milan.Nikolic](https://wordpress.org/support/users/milannikolic/)
 * (@milannikolic)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/change-schema-json-code-for-product/#post-12272924)
 * Thank you very much! This did the trick and I managed to do what I wanted.
 * Thanks again for the help.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/change-schema-json-code-for-product/#post-12273907)
 * That’s great! I’m glad you got it working.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Change schema json code for Product.’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/change-schema-json-code-for-product/#post-12273907)
 * Status: resolved