Skip Navigation

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.

This topic contains 1 reply, has 0 voices.

Last updated by Waqas Bin Hasan 4 months, 1 week ago.

Author Posts
January 24, 2025 at 3:02 pm #16631855

vasileiosS

<b>Background of the issue: </b>
I am trying to remove automatic paragraph and line break tags from HTML widgets in my WordPress theme by using the following code in my theme child functions.php:

remove_filter('widget_text_content', 'wpautop'); remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wpautop'); remove_filter('the_excerpt', 'wpautop');

. This works as expected until I activate the String Translation Plugin.

<b>Symptoms: </b>
After enabling the String Translation Plugin, the code to remove and br tags does not work, resulting in multiple p and br tags on new line characters in HTML widgets.

<b>Questions: </b>
How can I make the String Translation Plugin respect the code that removes and <br> tags?

January 27, 2025 at 6:17 am #16635894

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support. Meanwhile this ticket is attended by one of my colleagues, may I request you to try this with only WPML, String Translation and a default WordPress theme (like 2021 or 2024)? So we can see if nothing else is causing a conflict.

IMPORTANT: Please take full backup of your website and database beforehand. 

It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.

Please let us know your findings and we'll try our best to help you further on the matter.

Regards.

The topic ‘[Closed] Activating String Translation Plugin enables wpautop on html widgets while it’s deactivated on them…’ is closed to new replies.