WordPress – how to configure language – language_attributes()

Below are the steps I take to configure the

language_attributes()

used by WordPress.

This will control what is output by WordPress when your template uses

language_attributes()

, for example:

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

Before you begin you will need to know the code for the language. They are made up of a language code and country code – for example, en_AU for Australian English or en_BG for British English.

  1. Using your preferred method (such as FTP) open the WordPress directory on your server
  2. At the root level (typically a folder called www) you’ll find 
    wp-config.php
  3. Open it with a text editor
  4. Scroll down until you see
    define('WPLANG', '');
  5. And change it to include the language code required, for example
    define('WPLANG', 'en_AU');
  6. And that’s it – you may also find that WordPress will provide updates specifically for the language configured.