What do you do if your entire site is built using only Advanced Custom Fields and you need the site translated into a few languages?
The answer is WPML Multilingual CMS & Advanced Custom Fields Multilingual.
Before you begin, its best you have Advanced Custom Fields Pro, and a License for WPML Multilingual as you will need that to use Advanced Custom Fields Multilingual which is the ‘glue’ that joins ACF and WPML together.
There are a tonne of blog posts and forums posts on how this works, but it took us quite a lot of trial and error to make it function correctly.
The first thing we did was install all the required plugins, and create a backup with our preferred backup plugin Backup Buddy. We found that when reinstalling a backup from Backup Buddy, the site would not load due to an issue with “wpml_language_switcher” not copying correctly to our new database. It’s not worth the effort to clone this database field from the old site using phpMyAdmin (you can), as its easier to instead use Duplicator to make backups, which works well when you go to re-install.
As we were building many sites using the same theme, we had to ensure our Local JSON for our ACF fields was synced and hopefully final, as making the translation changes to this after the fact is time consuming if you have many nested fields/repeaters.
The first setting you need to change is in WPML.
Head to WPML settings, then under Post Types Translation, set “Field Groups (acf-field-group)” to Not translatable. Then go into your ACF Field Groups, and select the field you want to edit in the main group, ticking “Do not make ‘Field Groups’ translatable” under the Multilingual Content Setup box. Then in each actual field in that group, under “Translation preferences – What to do with field’s value when post/page is going to be translated” set this to Translate for every single field, including all your repeaters and cloned items.
In our case, we are unsure if we require totally custom content for all languages, and it is likely that we will have multiple “translated” pages that are unique in content and layout, so it makes it easier to just have every individual ACF field translatable. This also doesn’t appear to add any undue stress on the site thanks to the Local JSON, but in your case this may be different, so you could pick and choose which fields to translate if most things will stay the same.
Also to note, if you are using the Redirection plugin and you have it set to monitor URL changes, be weary of changing the permalinks/slugs on your translated pages as you will end up with redirections to nowhere.
Photo by Stuart Miles