---
title: Filter the shipping properties in product schema
url: "https://www.seopress.org/support/hooks/filter-the-shipping-properties-in-product-schema/"
lang: en-US
updated: 2026-01-26
hook_name: seopress_pro_wc_schema_shipping_details
required_version: 9.5
---

# Filter the shipping properties in product schema

- **Hook name:** `seopress_pro_wc_schema_shipping_details`
- **Required version:** 9.5

```php
add_filter('seopress_pro_wc_schema_shipping_details', 'sp_wc_schema_shipping_details', 10, 2);
function sp_wc_schema_shipping_details($shipping_offers, $wc_product) {

	// Example: add/override a shipping destination + delivery times.
	$shipping_offers['shippingDestination'] = [
		'@type'          => 'DefinedRegion',
		'addressCountry' => 'US',
	];

	$shipping_offers['deliveryTime'] = [
		'@type'        => 'ShippingDeliveryTime',
		'handlingTime' => [
			'@type'    => 'QuantitativeValue',
			'minValue' => 0,
			'maxValue' => 1,
			'unitCode' => 'DAY',
		],
		'transitTime' => [
			'@type'    => 'QuantitativeValue',
			'minValue' => 2,
			'maxValue' => 5,
			'unitCode' => 'DAY',
		],
	];

	// Example: set a custom shipping rate (if the schema uses a MonetaryAmount).
	$shipping_offers['shippingRate'] = [
		'@type'    => 'MonetaryAmount',
		'value'    => '9.99',
		'currency' => get_woocommerce_currency(),
	];

	// You can also use product data if needed:
	// $product_id = $wc_product instanceof WC_Product ? $wc_product->get_id() : 0;

	return $shipping_offers;
}
```

Source: [https://gist.github.com/wp-seopress/335474786ea9dd128b79000f23ab7478](https://gist.github.com/wp-seopress/335474786ea9dd128b79000f23ab7478)



