Skip Navigation
May 14, 2024

WPML provides a set of constants you can use in your theme or plugin’s PHP files and templates.

Besides constants defined by the WPML core plugin, you can use constants available for our add-on plugins.

On This Page:

WPML Multilingual CMS Constants


Use this constant to disable WPML object caching. The default value is false.


Setting this constant to true removes the language switcher JavaScript file (e.g.


Setting this constant to true removes the language switcher CSS (e.g.


For page builders, WPML provides a feature for automatically updating content.

To disable this feature set the value of this constant to false.


Use this constant to set the number of terms to display on the WPMLTaxonomy translation page. 

The default value is 1000.


Use this constant to define the server path for saving XLIFF files when downloading jobs from the WPMLTranslations page. For example: 

define('WPML_SAVE_XLIFF_PATH', '/home/test-user/Desktop');

After downloading a translation job, a copy of the file will be created in the defined folder.


By default, WPML’s language switcher flags are automatically resized to 18×12 pixels for consistency. 

Sometimes, you might not want to resize your flags. Fox example, they might be handled by a custom CSS or JavaScript or you want to display a custom animated GIF. In such cases, you can turn off automatic resizing by setting this constant’s value to true.

For more information check our page about customizing the language switcher flags.


Setting this constant to true enables logging of everything related to the WPML installer. This will create a log file called installer.log in your site’s ..\wp-content\plugins\sitepress-multilingual-cms\vendor\otgs\installer\ folder. 

This constant is intended to be used by developers only. For generic installer logs please go to WPMLSupport and then the Installer Support page in your site’s admin.


If you set this constant’s value to true, WPML and Toolset will stop automatically checking for updates. You will need to check for updates manually.


You can use this constant to set the maximum amount of jobs that can be exported to XLIFF from the WPMLTranslations page.

The default value is 1700. This is the number of jobs that all servers should be able to process in a reasonable time. If your site runs on a fast server, you can increase this limit if needed.

WPML String Translation Constants


Setting this constant to true syncs WPML translation files (MO files) between multiple servers.

For more information check our page about syncing translation files for sites running on multiple servers.


WPML String Translation scans and imports MO files to make them available for translation. You can use this constant to define the number of MO files that can be imported in one request.

The default value is 20000.

WPML CMS Nav Constants


Setting this constant to true disables WPML CMS Navigation caching. 

For more information check our page about the WPML CMS Navigation plugin.


Setting this constant to true disables the loading of cms-navigation-base.css and cms-navigation.css files.

WooCommerce Multilingual Constants


Use this constant to force WooCommerce Multilingual to use a specific country when querying a geolocated country.

The constant value should include a two-digit country code (e.g. GH for Ghana).


This constant can be useful for testing. For custom modules, please use the dedicated API hook.

Advanced Custom Fields Multilingual Constants


As of ACFML 2.0.4, you can use this constant to disable the feature to include field group strings in the post translation job.

To disable this feature, just add the following in wp-config.php:


Note 1: If a translation job was already created with the field group strings, the user needs to cancel it and create a new job.

Note 2: This does not affect the main field group translation feature. Field labels and Choices can be translated via String Translation directly.


To each translated field, ACF Multilingual adds information about the value in the original language. You can use this constant to hide annotation from translated fields.

To remove this information you can add the following line to your site’s wp-config.php file:



You can use this constant to set the default value of the repeater field sync feature. It is set to true by default.


Setting this constant to false disables scanning of JSON files for local fields.

This means that if you change the translation preference in local fields, it won’t sync to the database. You need to set the translation preference manually for fields. 

For more information check out the official ACF documentation about using local JSON.