Home › Forums › General Issues › Easiest way to create new WPML site with ACF
I am struggling with ACF and WPML a bit… I think I am opening up a huge can of worms using both together.
My customer will have between 10 and 20 different WMPL sites. To go live we will just have one or two. The customer wants to create the new sites himself. So I have been looking into it and I think ACF with WPML looks to be too difficult to do this. It seems when I create a new WPML language, I then need to go to every field group and duplicate them for the new language?
And then if we add a new field into a field group, I cannot see how to then copy that new field into the already duplicated field groups for each language?
Is there no way to just do this automatically when we create a new language, or have the option to choose ACF to be for ALL languages, not just one? Or is there any hool we can use to call the duplicate function automatically when a new WPML language is created? Why do we need to duplicate them ourselves, and not have the same fields in different languages? I looked into Toolset Types and this just works, when you create a new language post the fields are there already, no need to manually duplicate them (but I dont want to use Types because I cant assign custom fields to individual posts). Why cant ACF do the same please? Because ACF is a lot more powerful than Types, but not working very well with WPML is going to cause big issues.
Thanks
Hi @infoamitywebsolutions-co-uk
Have you checked the docs regarding WPML? You can check it out here: https://www.advancedcustomfields.com/resources/multilingual-custom-fields/. I believe you only need to translate the field group if you need to have different labels and settings.
I hope this helps 🙂
Thanks, but if I don’t translate it, the ACF fields do not appear on the translated entries. I have to translate the field group by duplicating it to each language in order to have them appear on an entry in the other languages.
I’m struggling with this issue as well.
I have a theme ready to sell, using ACF Pro Flexible Content as a page builder. I’m trying to integrate WPML, because I’ll be able to get more sales with this added, however the only way for users to create pages for other languages is to first duplicate all field groups. There are 2 problems with this:
1 – ACF will be hidden for those who purchase the them, as per the requirements of theme-bundled ACF Pro.
2 – Even if it were possible, I can’t expect users to do this. I’ll receive negative ratings on the theme.
So I either need to remove WPML support and lose sales, or completely rebuild it using something that supports WPML properly. I love ACF Pro, that’s why I’m using it. Is there any way that the duplication of field groups can be automated somehow? Visual Composer does this (but I’d rather not use it).
Cheers,
Klaye
Hi @infoamitywebsolutions-co-uk
If you don’t need to translate the field groups, then you need to set the “Field Groups” Custom Post Types translation to “Do Nothing” on WPML -> Translation Management page.
The problem occurs because ACF saves field groups and their fields as posts. If you translate a field group, then each language will have their own field group settings.
For that kind of situation, I suggest you register the fields via PHP code instead. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/register-fields-via-php/. That way you can take advantage of WordPress’ localization feature. This page should give you more idea about it: https://codex.wordpress.org/I18n_for_WordPress_Developers.
I hope this makes sense 🙂
Oh, so registering fields with PHP means not having to duplicate. Perfect, cheers James.
Hi James
I do need to translate them though. I understand about them being posts, but Toolset Types shows its fields on a new language without duplicating, its automatic and I think ACF needs an option to do that too. It would be best to just have the fields in all entries when you create a new language so you dont need to duplicate them every time. It would also be best when adding a new field that that is also copied across in the other language field groups automatically (or have an option to).
This would then make ACF much more compatible with WPML as its not very at the moment due to the manual duplication and missing new fields.
Hi @infoamitywebsolutions-co-uk
I don’t think this is easy to achieve due to the nature of ACF. But I think you could open a new ticket so your request can be passed directly to the plugin author. You can open a new ticket here: https://support.advancedcustomfields.com/new-ticket.
Thanks 🙂
Hi @infoamitywebsolutions-co-uk
I don’t think this is easy to achieve due to the nature of ACF. But I think you could open a new ticket so your request can be passed directly to the plugin author. You can open a new ticket here: https://support.advancedcustomfields.com/new-ticket.
Thanks 🙂
Hi James, are you not with ACF, and does ACF not monitor these forums or provide support on them??
Hi @infoamitywebsolutions-co-uk
Yes, I’m with ACF, but the plugin author rarely checks this forum. He always checks the submitted tickets, though. So, the best way to get support or to ask for a feature request is to submit a new ticket instead.
I hope this helps 🙂
WPML has a great guide on translation of ACF including a video on how to quickly duplicate the field groups. Unless I’m really misunderstanding the problem this video at about 1:38 shows the English field group being duplicated to Spanish the same as any other post types. But I’m not sure what the benefit is to translation of field groups other than the labels in the WP admin? Are you really fully translating the entire WP admin? Otherwise for the front-end why not just use English fields, any content entered can still be translated.
https://wpml.org/documentation/theme-compatibility/setting-wpml-advanced-custom-fields/
The video alone: https://www.youtube.com/watch?v=osUX987d0EQ
About the suggest automatic creation of the translated versions, would that be useful? If somebody puts up a bounty I might be into making it. Again just not sure how often field groups are actually being translated. It would be a neat challenge though, I think the sync feature would be great if you add a field to English it duplicates that field to the translated versions. That would be a timesaver for sure.
As far as the suggestion ACF “should” do this kind of thing automatically… I’d have to disagree. This is a translation feature, it’s up to WPML largely to provide the mechanism of translation. The way ACF provides it’s post type for translation is normal compatibility with WPML. If you want something that provides automation or simplifies the process I think it’s normal for that to be an additional plugin specific to bridging ACF/WPML. Certainly it would not be good for performance to have ACF presume you want translate field groups, and start syncing them, when probably 99% of site owners will never use that feature.
hi goldhat, yes I think you must misunderstand me, or I am misunderstanding ACF…
“Unless I’m really misunderstanding the problem this video at about 1:38 shows the English field group being duplicated to Spanish the same as any other post types.” -> the problem is this is a manual process and customers are asking why they have to do this. If we have all the extra content fields in English, people are asking why when they create a new language are the fields not there already. Editors/customers do not know about ACF, this is a developer tool to add content. They just see the content fields and think they will be there when they create new posts in the new language, but the fields are not there. The duplication process is technical. People are worried about doing it.
“But I’m not sure what the benefit is to translation of field groups other than the labels in the WP admin?” -> We are not translating labels. We are translating the field contents. If I create a new language, the ACF fields are missing from the new language pages and posts, so the website administrators cannot add the translated content. Not until the fields are manually duplicated to the other languages.
“Otherwise for the front-end why not just use English fields, any content entered can still be translated.” -> I dont understand this. It can only be translated after the field groups are manually duplicated to the other languages. What I am asking is can the field groups be automatically duplicated when you create a new language (some sort of hook you can use?)
“not sure how often field groups are actually being translated” -> Surely field groups are translated in every language? Why would a new language not have any custom fields?? Customers would like the same custom fields available to translate in the other languages. If I add a WYSIWG field for something like “Second Body Content” that would need to be in all the languages posts.
“I think the sync feature would be great if you add a field to English it duplicates that field to the translated versions. That would be a timesaver for sure.” -> yes
“I think it’s normal for that to be an additional plugin specific to bridging ACF/WPML” -> no way, not another plugin to add features to ACF. ACF should do this. Its nothing to do with WPML, its a feature of ACF, to be WPML compatible.
“Certainly it would not be good for performance to have ACF presume you want translate field groups” -> it would only happen at the time of creating a new language and a new field.
Edit: I would just like to add that I think ACF is fantastic for a single language WP website. Its a plugin we will use on all sites. I come from an Expression Engine and Craft background, and ACF means that WP can be made to be just as powerful (more powerful) than those CMSs. Its only with WPML that ACF has problems for us, due to not creating the fields in the other language automatically. Toolset Types does it. I read on forums that WPML recommend Toolset Types as its more compatible.
Good clarifying yes I expected it already worked that way that the field groups were copied (as English fields) to the new language. So your saying that doesn’t happen. However it doesn’t happen because they are posts and WPML blocks them from appearing, so the advice given earlier should resolve it:
If you don’t need to translate the field groups, then you need to set the “Field Groups” Custom Post Types translation to “Do Nothing” on WPML -> Translation Management page.
And the second option would be embed your ACF fields, which I like to do for plugins because then you can version control the fields… if your using git and your deploying in stages when you add a new field your going to want to test anyway so it does take away the interface but you gain a better testing process and easy deployment.
Have you run tests of these options to see if either resolve the issue? I see when those options were suggested you replied “… but I do need to translate the field groups”. That is not true as far as I can understand the problem. If your goal is just use the same fields say in Spanish pages as you used in English, and you don’t want Spanish labels in the admin… then you just want to prevent WPML from blockading the normal ACF placement. And that’s technically what’s happening there, it’s WPML that says hold on that’s English content we can’t show that on the Spanish edit page. But if you tell WPML hey I’m not trying to translate those field groups, let them in… they should show up.
“But if you tell WPML hey I’m not trying to translate those field groups, let them in… they should show up.” -> OH REALLY???! Wow, thats great, thats exactly what I was looking for. Its confusing because we DO want the field content to be translatable. So we ticked “Make ‘Field Groups’ translatable” because we assumed it means we can then add multilanguage content for them. But what the checkbox actually means is do you want the labels translated, and it also makes the field groups separate across languages. So it looks like unchecking this box makes the fields available across all languages. So if this works well then thats fantastic and I am glad I raised this question now, we would have been explaining to the customer how to duplicate fields in order to enter the translated ACF content.
Thanks
I hope it works but you will have to test that out, the other poster seemed convinced that would this way and it should. Hope it restores your faith in using ACF, personally I’ve used the other field manager you mentioned and it certainly doesn’t have the nice interface that ACF offers. But I’m a big fan of ACF and base a lot of plugins around it so I’m heavily biased in favor of it.
Keep me posted if you don’t getting it working this way I’ll probably fire up a test site right now I don’t have something active with WPML I can try it on.
The topic ‘Easiest way to create new WPML site with ACF’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.