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