-
Problem with priceCurrency Schema in Merchant Listings when WooCommerce Currency is Toman (Iran)
Hello Rank Math Support,
I’m facing a persistent issue with the product schema generated by Rank Math for WooCommerce.
My store is based in Iran, and the WooCommerce currency is set to Toman (تومان), which is the common currency used for pricing in Iranian online stores. However, Google Merchant Center requires a valid ISO 4217 currency code (like IRR) for structured data.
Here’s the problem:
Since Toman is not a valid ISO 4217 code, Google Merchant Center flags my product schema with the following error:
“Invalid ISO 4217 currency code in priceCurrency”
If I change the WooCommerce currency to IRR (Rial), the schema becomes valid and the error disappears, but this causes confusion for customers because prices are displayed in the wrong unit (Rial is 10x smaller than Toman).
I tried using the following code snippet (based on your filters) to force the schema’s priceCurrency value to be ‘IRR’, while keeping the frontend display in Toman:
php
Copy
Edit
add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
if ( ! is_product() ) {
return $entity;
}if ( isset( $entity[‘offers’][‘@type’] ) ) {
$entity[‘offers’][‘priceCurrency’] = ‘IRR’;
}return $entity;
}, 20 );
However, this doesn’t resolve the issue. Google still reports the same error even after clearing caches and verifying the rendered JSON-LD markup. I suspect Rank Math may be using internal WooCommerce currency settings that override this filter when rendering the final schema.Could you please help us achieve this behavior properly?
Desired behavior:
Keep WooCommerce currency display as Toman on the frontendForce Rank Math schema to use priceCurrency: “IRR” in the structured data
Any guidance or fix (maybe a specific hook, filter, or setting) would be very much appreciated.
Thank you in advance!
The ticket ‘Problem with priceCurrency Schema in Merchant Listings when WooCommerce Currency’ is closed to new replies.