14 Aug

Translating ACF Blocks With ACFML for a Multilingual WordPress Site

By Kathy Banach

In today’s connected world, your website serves as your international passport. It enables you to reach and engage with a diverse, global audience. But to effectively connect with your global consumers, you need more than just a website. You need a dynamic platform that allows you to rapidly and effortlessly add custom, compelling content.

That’s where Advanced Custom Fields (ACF) comes into play, offering you the tools to create highly customizable content.

But the journey doesn’t stop here. If you’re aiming for a truly global impact, you must speak the language of your audience. This means translating not just the posts or pages, but every aspect of your website – including the content coming from your ACF fields.

To achieve this, you need a solution that integrates with ACF and leverages the robust features it offers.

Why Translate Your WordPress Website?

Translating your website unlocks several benefits that enhance your site’s influence. A multilingual website allows you to:

  • Broaden your reach: Translated content speaks to global audiences, breaking down language barriers and expanding your potential user base.

  • Enhance user experience: Content in the user’s native language improves their browsing experience, making your site more accessible and relatable.

  • Achieve multilingual SEO: Multilingual websites rank better in search engines, increasing your site’s visibility on a global scale.

ACF PRO: A Step Above with Blocks

You might be wondering how the content you create with ACF fits into your multilingual website. Let’s consider a scenario where you’re using ACF PRO to create a website with custom and complex content. To go beyond the standard Gutenberg block, you use ACF Blocks. This empowers you to:

  • Create custom, reusable blocks tailored to your needs.
  • Integrate your custom fields directly into your blocks and display a greater variety of information.
  • Use your own CSS to style your blocks exactly how you want.
  • Provide your content creators with a user-friendly interface to add blocks without needing to know how to code.

Once you create your custom blocks, you can use them anywhere on your site and to display a variety of content. Be it testimonials from clients, the services you provide, introductions of your team members, or more – each piece of information is integral to your website. To effectively connect with your global audience, this information needs to be multilingual.

Translating ACF Content With ACFML

An add-on plugin from WPML (WordPress Multilingual), ACF Multilingual (ACFML) works with both ACF and ACF PRO to translate your ACF content and turn your site multilingual by adding translation options to the field group editor.

ACFML provides you with the flexibility to choose from two main translation options. Each caters to different field group setups and multilingual contexts.

  • Same fields across languages: If you have a straightforward field setup and want to maintain uniformity of fields across languages, this option is for you. It’s ideal when you have the same number of fields across all languages and your aim is to translate the field content.

  • Different fields across languages: For more advanced setups that use Repeater or Flexible Content fields, this option enables you to have a different layout or number of fields across languages.

Both of these translation options set the translation preferences for each field in your field group automatically. This means that once you’ve selected your preferred translation option, ACFML takes care of the rest, saving you from having to fiddle with additional translation settings.

If setting the translation preferences for each individual field is something you want to do on your own, you can choose the Expert option.

Selecting a translation option for your field group.

Selecting a translation option for your field group.

For the purpose of this tutorial, we’ll select the Same fields across languages option to translate the fields inside of it. This will let us show you the most efficient and affordable way to translate your ACF Blocks content – using automatic translation.

How Automatic Translation Works

Available with the ACFML Same fields across languages translation option, WPML’s automatic translation makes it easier to manage a multilingual WordPress site. You can choose between two translation modes:

  • Translate Everything Automatically: Translates your entire site (including ACF field content) in the background as you add or edit content.
  • Translate What You Choose: Lets you decide which posts, pages, and additional text you want to translate automatically in bulk.

You can opt for DeepL, Google, or Microsoft to power your automatic translations, with DeepL being WPML’s default translation engine. After WPML has done its magic, you can also review the translations to ensure they sound natural.

How to Automatically Translate Your ACF-Powered Site

There are just three steps to setting up ACFML to automatically translate all ACF content, including ACF Blocks.

Make sure you have the following plugins installed on your site:

  • ACF PRO
  • WPML core plugin and the String Translation add-on
  • ACFML add-on (comes with your Multilingual CMS or Agency account. You can find the plugin in the Downloads section of your WPML account)

To illustrate how WPML automatically translates ACF Blocks, we set up a test site with a Team Members block we built in ACF PRO. It has the following fields:

  • An Image field for the team member’s photo
  • A Text field for the team member’s name
  • A Text field for the team member’s position
  • A Text Area field for the team member’s bio

We then added the block to a Meet the Team page.

A view of the WordPress block editor showing a team member page using custom ACF Blocks. Three bios are shown, each with the fields described above.

A team member page using a custom ACF Block.

Let’s get started with the step-by-step guide on how to translate the page content automatically.

Step 1: Configure WPML

The WPML setup wizard guides you through the process, including choosing your preferred translation mode. By opting for the Translate Everything Automatically mode, WPML will translate your entire website, making your content accessible in multiple languages.

Selecting the “Translate Everything Automatically” mode in WPML.

Selecting the “Translate Everything Automatically” mode in WPML.

In the Plugins step, WPML suggests which components to enable based on your site’s plugins. Make sure the box next to Advanced Custom Fields Multilingual is checked as this add-on is crucial for translating your ACF field content.

Installing and activating the ACFML add-on.

Installing and activating the ACFML add-on.

Step 2: Set the Translation Option for Your Field Group

Navigate to ACF → Field Groups and edit the field group associated with your block. Under “Multilingual Setup” at the top of the page, select the Same fields across languages translation option.

The ACF field group after “Same fields across languages translation option” has been selected.

Selecting the “Same fields across languages translation option” for your field group.

Step 3: You’re Done! Take a Look at Your Automatic Translations

In a matter of minutes, WPML automatically translates your pages, posts, custom post types, custom fields, taxonomies, menus, and more. You can monitor the status of your automatic translations by going to WPML → Translation Management.

Monitoring the status of automatic translations in WPML, showing the number of translations left in the queue.

Monitoring the status of automatic translations.

Once WPML finishes translating, you can review your automatic translations to make sure they are accurate and sound natural. Then, all that’s left to do is take a look at your translated page — ACF Blocks content included — on the frontend of your website.

Two views of the "Meet the Team" page after translation. The English version is shown on the left, with the Spanish version on the right.

Final Thoughts

With powerful plugins such as ACF PRO and ACFML, your website can break language barriers and communicate with a much wider audience.

ACF Blocks enable you to design custom, compelling content that fits your specific needs, transforming your site into a dynamic platform. ACFML further empowers this transformation by providing flexible solutions for translating your ACF content, catering to even the most complex setups.

Plus, WPML’s automatic translations save you from the time-consuming task of translating content yourself. This leaves you with more freedom to concentrate on what’s truly essential – creating quality content for your audience.

About the Author

For plugin support, please contact our support team directly, as comments aren't actively monitored.