Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/load textdomain


Loads MO file into the list of domains.

If the domain already exists, the inclusion will fail. If the MO file is not readable, the inclusion will fail.

On success, the MO file will be placed in the $l10n global by $domain and will be an gettext_reader object.


<?php load_textdomain$domain$mofile ?>


(string) (required) Unique identifier for retrieving translated strings
Default: None
(string) (required) Path to the .mo file
Default: None

Return Values

First, will return true and exit if call to apply_filters('override_load_textdomain') returns true. If .mo file is not readable or the import fails - returns false. Otherwise returns true.



  • Uses global: (array) $l10n. Gets list of domain translated string objects.
  • l10n is an abbreviation for localization. There are 10 characters between the initial 'l' and the terminal 'n'

Change Log

Since: 1.5.0

Source File

load_textdomain() is located in wp-includes/l10n.php.


Localization: get_locale(), load_textdomain(), load_default_textdomain(), load_plugin_textdomain(), load_theme_textdomain()

See also index of Function Reference and index of Template Tags.