Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing issues with HTML not rendering correctly in translated pages of ACF fields on your site, where HTML code is visible instead of being rendered as text, particularly when using the Divi theme.
Solution:
We recommend adding the following code to your theme's functions.php file and then re-translate the affected page:

// WPML workaround for compsupp-7001
add_filter('do_shortcode_tag', 'wpml_compsupp7001_decode_et_pb_button_text', 10, 4);
  
function wpml_compsupp7001_decode_et_pb_button_text($output, $tag, $attr, $m) {
    if ( class_exists('Sitepress') && 'et_pb_accordion_item' === $tag && isset($attr['title'])) {
        // Decode both the ampersand and the apostrophe
        $output = html_entity_decode($output, ENT_QUOTES, 'UTF-8');
    }
  
    return $output;
}

This solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 8 replies, has 0 voices.

Last updated by robertoO-5 3 weeks, 5 days ago.

Assisted by: Dražen.

Author Posts
May 7, 2025 at 10:35 am #17005568

robertoO-5

Background of the issue:
I am trying to render HTML in ACF fields for translated product pages on my site hidden link. The HTML is rendered correctly in the Italian version (instead of .... I can see the table), which is the original, but not in the translated pages where I can see the code. The problem affects all codes, also youtube embed code.

Symptoms:
HTML code is visible on translated pages instead of being rendered as text.

Questions:
Why is the HTML not rendering in the translated pages?
How can I ensure that HTML is rendered correctly in all languages?

May 7, 2025 at 10:59 am #17005831

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

please share the access details of your website, so I can log in and take a look.

I’m enabling a private message for the following reply.

We have strict policies regarding privacy and access to your information.

Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/


- Please backup the site files and database before providing us access. 

- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.



Thanks,
Drazen

May 7, 2025 at 11:08 am #17005880

robertoO-5

Be careful via FTP, there's a production site in the root, the website we're talking about, it's in the staging6 folder.

Sorry I forgot to insert in the details.

I have daily and weekly backup, anycase.

Thanks for helping out.

May 7, 2025 at 11:10 am #17005883

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

sure, just please add wp-admin and FTP access.

I might need to take a copy of website, let me know if that is not okay.

Regards,
Drazen

May 7, 2025 at 11:55 am #17006299

robertoO-5

I sent the passwords again, it's ok to make a copy. Thanks

May 7, 2025 at 12:42 pm #17006636

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks, I checked and could see the problem, seems to be related to " and Divi.

I have also checked on localhost, and there it works fine. I have escalated this to our 2nd tier to further check.

I will update when I have some news, note it may take a day or two.

Regards,
Drazen

May 7, 2025 at 1:08 pm #17006750

robertoO-5

Thank you so much for helping, Dražen.
I will wait for updates from the 2nd tier.

Kind regards from Turin.

May 7, 2025 at 1:48 pm #17006885

robertoO-5

Strange things are occurring on my website now. I guess it's you working. Well, just for you to know, theme builder is no longer loading filters in the product category pages (that work as a shop > you can access from prodotti - products), sometimes links redirect wrong and the site is very, very slow.

I'm working for removing premmerce, so we have less issue on the website (just for you to know). When you'll be finished, I will remove Premmerce, if I manage writing a good htaccess that recover the correct links without losing google ranking.

Thanks for help, it's really appreciated.
I wait forward for your feedback.

Kind Regards, Roberto.

May 8, 2025 at 6:22 am #17009879

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Roberto,

we have added next code to your theme functions.php, and then re-translate the test page. hidden link

Seems to work fine.

Code:

// WPML workaround for compsupp-7001
add_filter('do_shortcode_tag', 'wpml_compsupp7001_decode_et_pb_button_text', 10, 4);
  
function wpml_compsupp7001_decode_et_pb_button_text($output, $tag, $attr, $m) {
    if ( class_exists('Sitepress') && 'et_pb_accordion_item' === $tag && isset($attr['title'])) {
        // Decode both the ampersand and the apostrophe
        $output = html_entity_decode($output, ENT_QUOTES, 'UTF-8');
    }
  
    return $output;
}

Regards,
Drazen

May 12, 2025 at 10:45 am #17022370

robertoO-5

Thank you, your help was crucial.
Kind regards from OMR.