Wrong currency code (RIAL instead of IRR) in Product Schema

#1098113
  • مهدی
    Rank Math free

    Hello,
    I have noticed an issue with the Product schema generated by Rank Math.

    Currently, the priceCurrency is being output as “RIAL”, but the valid ISO 4217 code for the Iranian currency is “IRR”.

    Because of this, Google Rich Results Test shows the following error:
    Invalid ISO 4217 currency code

    When I disable Rank Math, my theme outputs the correct IRR value, so the issue seems to be caused by Rank Math schema generation.

    Could you please fix this in the next update so that the correct IRR code is used for Iranian Rial?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    مهدی
    Rank Math free

    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/

    مهدی
    Rank Math free

    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!

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

You must be logged in to reply to this ticket.