The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
HTML Emails not dis...
 
Notifications
Clear all

Issue HTML Emails not displaying correctly

6 Posts
2 Users
0 Reactions
648 Views
(@webmeda-org)
Posts: 3
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#11073]

Wordpress is adding line breaks to my HTML code for my emails. I tried to follow online tutorials to remove the filter through functions php:

Can anyone help? Or explain why it's not working?

 

add_action('wpdiscuz_email_before_send_email', 'wpd_remove_wpautop_from_emails', 1);

function wpd_remove_wpautop_from_emails($args) {
    if ( isset($args['wpdiscuz_email_content']) ) {
        $args['wpdiscuz_email_content'] = str_replace(array('<p>', '</p>'), '', $args['wpdiscuz_email_content']);
        $args['wpdiscuz_email_content'] = str_replace(array('<br>', '<br />'), '', $args['wpdiscuz_email_content']);
    }
    return $args;
}
 

 
Posted : 29/10/2025 10:07 pm
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi, @webmeda-org,

Please try this code: 

add_filter('wpdiscuz_confirm_email_content_pre_replace', 'wpd_remove_wpautop_from_emails', 1);

function wpd_remove_wpautop_from_emails($message) {
    if ($message) {
        $message = str_replace(['<p>', '</p>'], '', $message);
        $message = str_replace(['<br>', '<br />'], '', $message);
    }
    return $message;
}

In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 30/10/2025 2:47 pm
(@webmeda-org)
Posts: 3
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

 
Posted : 30/10/2025 10:16 pm
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@webmeda-org 

Your post appears to be empty. Could you please confirm whether the issue has been resolved?


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 31/10/2025 1:33 pm
(@webmeda-org)
Posts: 3
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I was trying to show you the code before and after saving and I think that's breaking my comment, I tried to attach them as files but that's also not allowed


 
Posted : 31/10/2025 8:01 pm
Asti
 Asti
(@asti)
Posts: 8264
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@webmeda-org 

Please record a video, so we can see the problem. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 01/11/2025 11:43 am