How To

Set a Specific Language in WP Ghost Plugin

Display WP Ghost in a specific language regardless of your WordPress dashboard language using either the built-in Plugin Translations toggle or a custom plugin_locale filter in wp-config.php. By default, WP Ghost displays in your WordPress dashboard language if a translation is available. Two scenarios are common: you want to use the plugin’s bundled translations instead of WordPress’s general language pack (use the built-in toggle), or you want to force a specific language different from your dashboard (use the wp-config.php method). Both methods only affect WP Ghost – your dashboard and other plugins remain in their configured language.

Method 1: Built-in Plugin Translations Option

WP Ghost ships with bundled translation files for several languages. By default, WordPress checks the global wp-content/languages directory first. The Built-in Plugin Translations option reverses this priority so WP Ghost loads its own translations before falling back to the global directory.

  1. Go to WP Ghost > Advanced.
  2. Find the Built-in Plugin Translations option.
  3. Toggle it ON.
  4. Click Save.

WP Ghost will now load translations from its own languages folder first, ensuring you always get the most up-to-date translations included with the plugin version you’re running.

When to use this option: Enable it if your dashboard language doesn’t match WP Ghost’s translation, if WP Ghost shows partially translated text, or if you want to use the latest translation strings shipped with the plugin update. The current version includes translations for English, French, German, Spanish, Italian, Portuguese, Dutch, Romanian, Russian, Turkish, and Indonesian.

Method 2: Force a Specific Language via wp-config.php

If you want to force WP Ghost to display in a specific language different from your WordPress dashboard language (for example, your site is in French but you prefer the WP Ghost interface in English), use the plugin_locale filter in wp-config.php.

  1. Open wp-config.php via your hosting File Manager, FTP client (like FileZilla), or cPanel File Manager. The file is located in your WordPress root directory.
  2. Add the following code at the end of the file, before the line that says /* That's all, stop editing! */:
add_filter( 'plugin_locale', function ( $locale, $plugin ) {
    if ( $plugin === 'hide-my-wp' ) {
        return 'en_US'; // Forces WP Ghost to use the en_US locale
    }
    return $locale;
}, 11, 2 );
  1. Save the file. If you used FTP, upload it back to the WordPress root directory.
  2. Refresh your WordPress dashboard. WP Ghost now displays in the language you specified.

Important: Always back up wp-config.php before editing. A typo or misplaced character can break your entire site. If something goes wrong, restore the backup and try again.

To use a different language, replace en_US in the code with your preferred locale. For example, fr_FR for French, de_DE for German, or es_ES for Spanish.

Common Locale Codes

WordPress locale codes follow the format language_COUNTRY. Use these for the WP Ghost languages currently supported:

LanguageLocale Code
English (US)en_US
Frenchfr_FR
Germande_DE
Spanishes_ES
Italianit_IT
Portuguese (Brazil)pt_BR
Dutchnl_NL
Romanianro_RO
Russianru_RU
Turkishtr_TR
Indonesianid_ID

For the complete list of WordPress locale codes, see the WordPress Polyglots Teams page.

Frequently Asked Questions

Which method should I use?

Use the built-in Plugin Translations option if you want WP Ghost to use its own bundled translations in your dashboard’s language. Use the wp-config.php method if you want to force WP Ghost into a specific language different from your dashboard. The built-in option doesn’t change the language – it just changes which translation files are loaded.

Will this affect my dashboard or other plugins?

No. Both methods only affect WP Ghost. Your WordPress dashboard, other plugins, and your site frontend remain in their configured language. The plugin_locale filter checks specifically for the hide-my-wp plugin slug and only modifies that plugin’s locale.

My language isn’t in the table. Can I still use it?

You can use any WordPress locale code in the wp-config.php method, but if WP Ghost doesn’t have a translation for that language, the interface will fall back to English. To contribute a translation for your language, visit the WP Ghost translation project on WordPress.org.

How do I undo this change?

For the built-in option, toggle it off in WP Ghost > Advanced and save. For the wp-config.php method, remove the add_filter code block from wp-config.php and save. WP Ghost will return to using your dashboard’s language.

Does WP Ghost modify WordPress core files?

No. WP Ghost itself never modifies core files. The wp-config.php method requires you to manually edit one file – wp-config.php – which contains your site configuration but is not technically a core file. WordPress doesn’t overwrite wp-config.php during updates.

Customize WP Ghost behavior:

John Darrel

Change the WordPress Database Prefix for Security

Replace the default wp_ database prefix with a random one to protect against SQL injection…

1 year

Customize WordPress Uploads Directory | WP Ghost

Change the WordPress uploads directory path with WP Ghost (rewrite rules, no files moved) or…

1 year

WP Ghost and WP Rocket Cache Setup Guide

Configure WP Ghost with WP Rocket cache. Enable file optimization, Change Paths in Cache Files.…

1 year

Why is website security important?

https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…

1 year

Is WordPress Website Easily Hacked?

The security of your WordPress site depends on multiple factors, such as the strength of…

1 year

Set Up WordPress 2FA with Mobile Authenticator Apps

Step-by-step guides to connect WP Ghost 2FA with Google Authenticator, Authy, Microsoft Authenticator, or LastPass.…

1 year