Setting up a MultiLingual WordPress Site with Polylang
You can set up a Multilingual WordPress site with a great plugin called Polylang, there are a few ways to make multilingual sites and people can get quite opinionated about this, for larger sites with complete duplication you may want to consider doing it with a multi-site set up but for smaller needs you can get away with a smaller set up.
One of the key things to note is that these plugins or set ups won’t translate your content into another language you still need to get your text translated and provided in the other language ready to be pasted into your page
This guide looks at setting up a mulitlingual site with a free plugin maintained by an active developer, first thing is to make sure the WordPress theme is Internationlised which essential means the theme is ready to be translated into other languages, a process known as localisation.
Polylang
Download and install Polylang activate it. Go to settings via the plugin or via Settings > Languages, here is where you add the desired languages.
When you add the language the required .mo and .po files are downloaded and filed in wp-content/languages/
Now since this is a multilingual site as well as our other languages we also need to add in our default language which more than likely will be English add this in the same way and pick your English flavour, US, GB, CA or AUS. This will also determine the flag used on the language switcher.
Next is to swap to the Settings tab and set the default language.
Also here set your URL settings, I like to keep it simple and not set the language abbreviation in the URL and remove the word /languages/ from the URL string. This is also a safeguard in that if the plugin was deactivated I would still have all my links working for the default language.
It’s also worth pointing out here that all additional content added via Polylang for additional languages is stored additionally in the WordPress database so disabling the plugin leaves the core language and re-enabling the plugin adds back in all the other language content.
On a first time install you will also be asked There are posts, pages, categories or tags without language set. Do you want to set them all to default language ? Where you can set these to the default language.
On the middle tab string translations, certain WordPress settings, plugins and widgets are available where you can enter in the other languages text strings.
Sorting out the Menus
Next up is to address any pre-existing menus, you need to resave the menu to the default language and create new menus for the other language. Additional theme locations are added per menu per language.
So if an exact duplicate menu is required for the 2nd language, create the menu and assign the 2nd language theme location.
Menu Switcher
Polylang gives an option of adding a menu language switcher between the languages to add to the menu.
You will need to add the switcher to both language menus to be able to toggle between languages.
Widget Switching
Widgets are handled by adding additional widgets in the appropriate areas and selecting whether you are displaying them for one or multiple languages.
Post & Pages Switching
Since we have already set default language on post/page/cat & tag (in the set up of the plugin) we have the content in it’s intended language to create an equivalent page in the other language just click the translation pencil edit icon and add in your multilingual content.
These posts/pages are then available in the menus so you can add them into your other language menu.
For categories and tags the same procedure applies.
Flag Switcher
As well as the menu switcher there is a widget switcher which can display a number of indicators to swap language which can be place in any widgetised area.
Hello i wonder what should i set on the page code for the href lang= … to declare the languages .. or is not needed? Best Regards
Im using Sydney theme but when I activated polylang my page styles went off. Is there anyway to make it right?
I have downloaded the plugin but the settings do not show the default language option…
Hi, any idea on best option for setting up polylang without redir 302 wich affecct the seo results? The main url redirect with a ‘302 Found’ respond code and because of that this url does not get indexed by the search engines..
Thanks! This was very helpful!
Of so many posts I’ve read, this is the most easy-understanding and informative post! Thanks for sharing.