Change HTML language from en-US in to en-GB in WordPress?

23,561

Solution 1

Define the language attribute using:

define ('WPLANG', 'en-GB');

You can get more information on it at http://codex.wordpress.org/Installing_WordPress_in_Your_Language

Solution 2

As for recent version of WordPress 4+ this option

define ('WPLANG', 'en-GB');

is deprecated, to update the language you need to follow either one of the following methods:

Method 1

Inside the wp-config.php put the following line:

$locale='en_GB';

Method 2 (recommended)

In database, XY_options table to and set an option of WPLAN to en_GB (where XY is the table prefix for your wordpress installation)

exemple queries:

insert

INSERT INTO `XY_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES (NULL, 'WPLANG', 'en_GB', 'yes');

update

UPDATE `XY_options` SET `option_value` = 'en_GB' WHERE `option_name` = 'WPLANG';

Solution 3

I am using Wordpress 5.1.1 , at wp-config.php, choose right top line, put

$locale='vi_VN';

(For example, in case of Vietnamese language)

Share:
23,561
Martin Bean
Author by

Martin Bean

Updated on July 05, 2022

Comments

  • Martin Bean
    Martin Bean almost 2 years

    This may sound like a simple and trivial question, but I'm using the following tag in a WordPress theme header file:

    <html <?php language_attributes(); ?>>
    

    Which is outputting:

    <html dir="ltr" lang="en-US">
    

    I wish to change the lang attribute to "en-GB" as my blog and the language posts are written in are British English (en-GB) but I can't find where this parameter is set in the WordPress admin settings, and there isn't a value for it in the wp_options database table either, which leaves me to believe setting the lang value must be some sort of dark art?

  • its_me
    its_me over 11 years
    Note to self: I've noticed that most English sites have this set to define ('WPLANG', 'en'); — yeah, just en and not en-US (which is the default).
  • Martin Bean
    Martin Bean over 4 years
    …and this is why I hate WordPress development. Need to change a config option? “There’s a plugin for that…”