How to Set a Specific Language in WP Ghost – Plugin Translation Guide
November 8, 2024
This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.
Quick summary: Display WP Ghost in a specific language using the built-in Plugin Translations toggle in WP Ghost > Advanced, or force a specific locale by adding a plugin_locale filter to wp-config.php. Both methods only affect WP Ghost – your dashboard and other plugins stay in their own language.
Why Set a Specific Language for WP Ghost
By default, WP Ghost displays in your WordPress dashboard language if a translation is available. Two common scenarios require changing this. First, you want WP Ghost to use its own bundled translations instead of the global WordPress language pack (which may be outdated or incomplete). Second, your dashboard is in one language but you prefer WP Ghost’s interface in another, like running a French dashboard but reading security settings in English.
WP Ghost supports both scenarios with two different methods.
| Method | Best For | Code Required |
|---|---|---|
| Built-in Plugin Translations (dashboard) | Using WP Ghost’s latest bundled translations | No |
| plugin_locale filter (wp-config.php) | Forcing a specific language different from your dashboard | Yes |
Method 1: Built-in Plugin Translations (No Code)
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 first.
1. Go to WP Ghost > Advanced.
2. Find the Built-in Plugin Translations option.
3. Toggle it ON.
4. Click Save.
WP Ghost now loads translations from its own languages folder, ensuring you always get the most up-to-date translation strings included with the plugin version you are running. The current version includes translations for English, French, German, Spanish, Italian, Portuguese, Dutch, Romanian, Russian, Turkish, and Indonesian.
Use this method when your dashboard language does not match WP Ghost’s translation, when WP Ghost shows partially translated text, or when you want the latest translations shipped with the plugin.
Method 2: Force a Specific Language via wp-config.php
If you want WP Ghost to display in a specific language that is different from your WordPress dashboard language, use the plugin_locale filter. For example, your site is in French but you prefer reading WP Ghost settings in English.
Add the Filter Code
1. Open wp-config.php via your hosting File Manager, FTP client, or cPanel.
2. Add the following code 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 );3. Save the file. If you used FTP, upload it back to the WordPress root directory.
4. 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 site. If something goes wrong, restore the backup.
To use a different language, replace en_US with your preferred locale code. 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. Here are the codes for the languages WP Ghost currently supports:
| Language | Locale Code |
|---|---|
| English (US) | en_US |
| French | fr_FR |
| German | de_DE |
| Spanish | es_ES |
| Italian | it_IT |
| Portuguese (Brazil) | pt_BR |
| Dutch | nl_NL |
| Romanian | ro_RO |
| Russian | ru_RU |
| Turkish | tr_TR |
| Indonesian | id_ID |
If your language is not in this list, you can still use its locale code, but WP Ghost will fall back to English if no translation is available. To contribute a translation for your language, visit the WP Ghost translation project on WordPress.org.
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 that is different from your dashboard. The built-in option does not change the language itself – it changes which translation files are loaded first.
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 is not supported. Can I still use it?
You can use any WordPress locale code in the wp-config.php method, but if WP Ghost does not have a translation for that language, the interface will fall back to English. You can contribute a translation through the WordPress.org translation platform.
How do I undo the language 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 never modifies core files. The wp-config.php method requires you to manually edit wp-config.php, which contains your site configuration but is not a WordPress core file. WordPress does not overwrite wp-config.php during updates.
Related Tutorials
For more WP Ghost customization options:
Advanced WP Security – All advanced settings in WP Ghost including the Plugin Translations toggle.
Customize Paths in WP Ghost – Main path security configuration guide.
Preset Security Options – One-click security configurations for fast setup.
Install WP Ghost Plugin – Step-by-step installation guide.
Disable WP Ghost in Case of Error – Emergency recovery steps.