Hello,
We apologize for the issue you are facing with the currency code in the Product Schema generated by Rank Math. Thank you for bringing this to our attention.
Currently, the correct ISO 4217 code for the Iranian currency is indeed "IRR", and it seems that there is a discrepancy in how Rank Math is outputting this value. We recommend checking your WooCommerce settings to ensure that the currency is set correctly under WooCommerce → Settings → General.
If the issue persists, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. Your feedback is valuable, and we will consider it for future updates.
Thank you for your understanding!
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Here is a product page on my site where the currency is still showing as RIAL instead of IRR in the schema: https://rtlhtml.com/downloads/%d9%82%d8%a7%d9%84%d8%a8-%d8%b4%d8%ae%d8%b5%db%8c-beny/
Hello,
Thank you for your previous reply. I wanted to update you:
I confirmed that the issue comes from Rank Math’s Product schema where priceCurrency outputs as RIAL/IRT instead of the valid ISO 4217 code IRR.
As a temporary workaround, I added the following snippet to my site, and now Google Rich Results Test no longer shows the “Invalid ISO 4217 currency code” error:
add_action(‘template_redirect’, function () {
if ( is_admin() ) return;
ob_start(function ($html) {
$html = str_replace(‘”priceCurrency”:”RIAL”‘, ‘”priceCurrency”:”IRR”‘, $html);
$html = str_replace(‘”priceCurrency”:”IRT”‘, ‘”priceCurrency”:”IRR”‘, $html);
$html = str_replace(‘itemprop=”priceCurrency” content=”RIAL”‘, ‘itemprop=”priceCurrency” content=”IRR”‘, $html);
$html = str_replace(‘itemprop=”priceCurrency” content=”IRT”‘, ‘itemprop=”priceCurrency” content=”IRR”‘, $html);
return $html;
});
});
Could you please confirm if it is safe to use this snippet until you release an official fix? Also, do you plan to correct the currency code in an upcoming update?
Thanks again for your support!