Leave a Reply

3 comments

  1. This will need to go in a plug-in, just put the following inside a file (login-languge.php) in wp-content/plugins/

    /*
    Plugin Name:  Log-in Language
    Plugin URI:   http://wordpress.stackexchange.com/questions/72692/how-do-i-change-the-language-of-only-the-login-page
    Description:  Changes the language for log-in/register screens only
    Author:       Stephen Harris
    Author URI:   http://stephenharris.info
    Version:      1.0
    License:      GNU GPL 2
    */
    add_action('plugins_loaded', 'wpse72696_login_language_init');
    
    function wpse72696_login_language_init(){
        if( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ){
            add_filter('locale', 'wpse72692_login_language',10);
        }
    }
    
    function wpse72692_login_language( $locale ){
        return 'en_US';
    }
    
  2. You can repalce define( 'WPLANG', 'de_DE'); in your wp-config.php by this code structuer.

    if (basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)) == 'wp-login.php'){
        define( 'WPLANG',  'en_US');
    } else {
        define( 'WPLANG',  'de_DE');
    }
    
  3. Another way you can do this in your functions.php using unload_textdomain($domain)

    add_action('init', 'remove_login_translation');
    function remove_login_translation() {
        if( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ) {
            unload_textdomain('default');
        }
    }