In short. WooCommerce core generates Product JSON-LD in WC_Structured_Data::generate_product_data() and outputs the collected data through wp_footer.
Definition: Product JSON-LD is machine-readable product information embedded in a web page. As of 17 October 2026, WooCommerce core builds this information in
WC_Structured_Data::generate_product_data()and prints the collected structured data through thewp_footerhook.
Key facts
- WooCommerce's product structured data reference documents automatic output on single product pages and instructs readers to search the page source for
application/ld+json. - The core structured data class reads product fields and supplies offer and rating data conditionally.
- WooCommerce's product editor documentation places editing under Products > All Products, followed by Edit on the relevant product.
Which core code generates the markup?
The core class source registers generate_product_data() on woocommerce_single_product_summary at priority 60. It registers output_structured_data() on wp_footer at priority 10. The implementation lives at:
plugins/woocommerce/includes/class-wc-structured-data.php
WooCommerce's structured data reference documents woocommerce_structured_data_product_offer for offer markup and woocommerce_structured_data_product for the complete product data. A filter is a code hook that lets custom code change the supplied values. The reference shows the product filter adding or changing a value before output.
Which product inputs supply the values?
The core implementation reads the product name, permalink and main image. Its description uses the short description, falling back to the main description, with shortcodes processed and HTML tags removed. Its sku uses the SKU, or the product ID when empty. A valid global trade item number, prepared from the global unique ID, supplies gtin.
Offers depend on a nonempty price and use store currency and stock status. Aggregate ratings require product ratings and enabled review ratings. Core skips the Product node when offers, aggregate ratings and reviews are all absent.
WooCommerce's editor guide identifies separate Product description and Product short description panels. It locates Regular price and Sale price under Product data > General; variable products have prices under Product data > Variations. These are the editing locations to compare with the corresponding output values.
How can the output be checked?
The WooCommerce reference directs readers to view a product page's source and search for this exact string:
application/ld+json
The reference's example contains @type: Product, a product name, an image, a description, an SKU and an offers array. The page can also contain breadcrumb structured data, so identifying the Product object matters when inspecting the result. The same reference says marked-up data should already be visible on the page.
Related terms
- JSON-LD
- Product structured data
- Where do I edit a WooCommerce product's short description?
- Where do I enter a product's identifiers in WooCommerce?
FAQ
Do I need to write a JSON-LD block for every product?
WooCommerce's structured data reference documents automatic product markup. You can inspect the output in the product page source before considering custom code.
Where do I change a product's price?
The editor guide directs you to Product data > General for a regular or sale price. For variable products, use Product data > Variations, then select Update to save.
Does the reference describe default output on category archives?
The same WooCommerce reference says automatic product structured data is no longer output on archives. It separately provides custom code that generates product data during a shop loop.
Sources
- WooCommerce, "Structured data for products", undated
- WooCommerce, "class-wc-structured-data.php", source at tag 11.2.1
- WooCommerce, "WooCommerce Product Editor settings", undated
Check how a page reads to answer engines. Open the GEO score analyzer