In our previous post How to Translate a WordPress Website, we’ve outlined some important things to consider before starting a localization project. Here is how you can get down to business and translate your WordPress site using one of the most popular localization plugins: Polylang.
Just follow each step of the following SOP, carefully, and your translated website will be up in no time.
- Backup the entire website so you can rollback if anything goes wrong. For example with the UpdateDraft plugin.
- Install & Activate the Polylang Plugin (free or Pro).
- Install Polylang Copy Content plugin. This will enable you to automatically copy the content to the new language posts (if using Gutenberg or other page builders which don’t do this automatically).
- Under Languages, add original language
- Set existing posts and pages to default language
- Add new language and set order
- Go to String Translation: translate strings (usually belonging to theme and widgets)
- Go to Settings and URL modifications: select desired structure. The option “language set from directory name” is recommended since other options can have a negative impact on SEO. Other options can be selected based on preference.
- Settings/Detect browser language: Select what you prefer.
- Settings/Media: Keep activated to be able to translate your media title, alt text and description. This is recommended by Google because otherwise not all elements are in the same language.
- Settings/Synchronization: This will copy certain settings across languages.
- Go to Lingotek: Activate if you want to use machine translation or use their system to order translations.
- Go to Appearance/Menus: View your main menu and if not selected, choose “Primary Menu [original language]”
- Add Language Switcher to your menu. If not visible as menu item option on the left, go to “Screen Options” (top right) and enable the Language Switcher.
- Choose Language Switcher settings as you like.
- Create a new menu for each new language and set it as primary menu for that language.
- Go to Appearance/Widgets: Here you need to find all widgets that display text and assign the correct language to them. For the additional language, add the same widgets once more and add & select the proper language, again.
- Go to Post/Categories to translate the categories. Edit each category by entering the translation in the translation field. After doing that, you still need to add a new category with the translated category name as entered in the original category.
- To create a translation of a post or page, go to the post/page list and create a copy by clicking on the plus symbol for the new language.
- In case of posts, add the correct category.
- When adding media, note that no uploaded media might be shown for your new language. To use previously uploaded media, you need to find it in the Media section first, and add a language translation for the media element you want to use in the translated posts.
- If you find your theme or 3rd party plugins not to be compatible, a plugin such as Theme and plugin translation for Polylang (TTfP) could enable you to translate the necessary parts.
After following all these steps, you are ready to build a full translated version of your site! If you find something to be missing or have questions, feel free to comment below.