1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Remove the “If you don’t want to receive these emails in the future, please unsubscribe.” Text in the Email Footer

How to Remove the “If you don’t want to receive these emails in the future, please unsubscribe.” Text in the Email Footer

Introduction

BuddyBoss and WordPress do not provide a built-in option to remove the unsubscribe disclaimer text that appears in the email footer (for example: “If you don’t want to receive these emails in the future, please unsubscribe.”). If you would like to remove this text, you can do so using a custom function that filters the email content before it is sent.

Custom Workaround

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, click Theme Functions (functions.php).
  4. Paste the following code just before the closing PHP tag (?>):
function remove_email_footer_paragraph( $content ) {
    // Define the paragraph to be removed
    $pattern = '/<p style="margin: 5px 0;">.*?<\/p>/s';

    // Remove the specific paragraph from the email content
    $content = preg_replace( $pattern, '', $content );

    return $content;
}
add_filter( 'wp_mail', 'remove_email_footer_paragraph' );
  1. Click Update File to save your changes.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The unsubscribe text is still showing in emails.
A: Make sure the code is added to the active theme’s functions.php file and that no other plugin is injecting or modifying the email footer after wp_mail runs.

Q: Will this remove other paragraphs from my emails?
A: The snippet targets paragraphs matching a specific inline style. If your email template uses the same style for other paragraphs, those may also be affected. In that case, the pattern may need to be refined.

Q: Does this affect all outgoing emails?
A: Yes. This filter applies to all emails sent using wp_mail().

Q: Can I revert this change easily?
A: Yes. Simply remove the code from functions.php and save the file.

Q: Who can I contact for further assistance?
A: Please review the BuddyBoss Support Policy or consult a qualified developer for advanced customizations.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.