Blog

Learning how to Persianize numbers in WordPress

Hamid Nataj

February 20, 2025

11:08 pm

No answer

One of the constant challenges of WordPress users on Iranian sites is how to Persianize numbers in WordPress. Even though the language is Persian and the Persian font is selected, the numbers are displayed in Latin! This tutorial examines different ways to fix this problem and also explains the simplest way.

Methods for Persianizing Numbers in WordPress
Displaying numbers in Latin when the site language is Persian; gives your site an undesirable and unprofessional appearance and also harms the site’s user experience. Convert English numbers to Persian with the help of the following methods:

Install a font that supports Persian numerals
The most important reason why; despite choosing a Persian font, the numbers are still Latin; is the lack of support for Latin numerals in the font. You probably use popular and common Persian fonts in your design, but the current font does not have Persian numerals. So be sure to install a version of the font that supports Persian numerals (farsi_numerals).

PHP coding to convert numbers to Persian
By placing the following code in the functions.php file of the WordPress template, all numbers on the entire site will be converted from English to Persian. So if you have a bilingual site, this method is not suitable for you. The next point is that the numbers are only displayed in Persian, but in your database the numbers remain in Latin.

Note: Access to the functions.php file of the template is possible in two ways: the WordPress dashboard and the host file manager.

To access via the WordPress dashboard, go to the display menu and the theme file editor, and to access this file via the host, enter the file manager and the path: public_html folder > wp-content folder > themes folder > site template folder > functions.php file.

JavaScript coding to convert Latin numbers to Persian
The following code must be placed in the site header (template header.php file) or actually between the </head><head> tag:

Note: To add JavaScript codes to the site header, if you have Elementor installed, use the path Dashboard> Elementor> Elementor Custom Code or the Code Snippets plugin.

Persianizing numbers in WordPress with the help of a plugin
Plugins in WordPress always make our work easier; they are the simplest solution, but they add a lot of additional code to our site. The following plugins are recommended to convert Latin numbers to Persian in WordPress:

Parsi Date plugin
parsi date In addition to adding a solar calendar to the site; it also provides settings for Persianizing numbers.
You can download this plugin from the WordPress repository.

To Persianize numbers with the help of the Parsi Date plugin, after installing and activating the plugin, open the Parsi settings menu from the WordPress dashboard and go to the Conversion tab.

Other plugins such as wp-jalali (Persian WordPress) and WP-Persian also have the ability to convert numbers to Persian and Persianize them, but given that the plugin creators did not provide a new update at the time of writing this tutorial, we recommend using the Parsi Date plugin.

Conclusion
The easiest way to Persianize numbers in WordPress is to install a suitable font that includes Persian numbers. If this is not possible for you; you can use PHP or JavaScript coding or the recommended plugins.

Leave a Reply

Your email address will not be published. Required fields are marked *