WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Good day! I don't know much code so I've been researching on how to modify my wp-config.php file so that the content and widgets of my site will show in the four languages (aside from English) I have on there. I don't care about translating the WP interface, just the content. The WP .mo files in the languages in question are already in the wp-content/languages folder. How would I define 4 languages in wp-config.php? Like this?

define ('WPLANG', 'es_ES'); ('WPLANG', 'de_DE'); ('WPLANG', 'fr_FR'); ('WPLANG', 'ca_CA')

I've been trying things out (only way for me to learn) but ended up destroying the file and having to restore it. Besides, like I said, no reliable info on the net. Cheers :)

share|improve this question
That won't work, there's no functionality in WordPress that allows you to edit a post in more than one language anyway. To do this find a multilingual plugin to install, like this one – onetrickpony Jun 23 '11 at 2:09
as @One-Trick-Pony says, defining it like you want in the wp-config.php is impossible. I would like to suggest another multilingual plugin though: WPML (wpml.org) – Piet Jun 23 '11 at 2:42

I just found this which I applied and works perfectly:

If you have your blogs installed in subdirectories you could use this solution:

if (strpos($_SERVER['REQUEST_URI'], '/enblog') === 0) {
    define ('WPLANG', 'en_US');
} else {
    define ('WPLANG', 'pl_PL');

... and so on. Good luck!

share|improve this answer
This is an old question/answer but wouldn't this cause the language to change for everyone browsing the website when multiple people are present at the same time? – RST Jun 20 '15 at 9:31

if you are somehow using .mo files to translate the content strings (and your theme is calling the necessary __() or _e() functions) then you could possibly get away with a much simpler option than wpml.

You could use the simple but effective plugin http://www.viper007bond.com/wordpress-plugins/other-plugins/in-their-language/

it detects language of browser if possible and then sets the wp locale accordingly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.