WooCommerce emails come with the following hard-coded (argh!) greetings: ‘Thanks for shopping with us.‘, ‘Thanks for reading.‘, ‘We look forward to seeing you soon.‘, ‘We look forward to fulfilling your order soon.‘, ‘Thanks!‘, ‘We hope to see you again soon.‘ based on the specific email.
While having these greetings in the WooCommerce customer email footer may look nice and friendly, you should have the freedom to remove or edit them.
So, you have two choices: doing that via the email settings, or by “translating” those strings via PHP. Enjoy!
WooCommerce Options: Edit or Remove “Thanks for shopping with us.” and other greetings @ WooCommerce Customer Order Emails
Just go to WooCommerce > Settings > Emails and open a given email, then delete or change the “Additional Content” input field value:
PHP Snippet: Hide “Thanks for shopping with us.” and other greetings @ WooCommerce Customer Order Emails
/**
* @snippet Hide Greetings @ WooCommerce Emails
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 4.6
* @community https://businessbloomer.com/club/
*/
add_filter( 'gettext', 'bbloomer_translate_woocommerce_strings_emails', 999 );
function bbloomer_translate_woocommerce_strings_emails( $translated ) {
// Get strings and translate them into empty strings
$translated = str_ireplace( 'Thanks for shopping with us.', '', $translated );
$translated = str_ireplace( 'We hope to see you again soon.', '', $translated );
return $translated;
}
Hi, I’m just curious. Are your instructions to to EITHER remove “Thanks for shopping with us.” from the Additional Content section of the dashboard or use the snippet, or is it necessary to do both? The reason I ask is because I removed it from the Additional Content field in the dashboard and it still appears in my emails and I’m perplexed as to why Woocommerce would hard code this in our emails if that field is blank. A quick and dirty method that should also work is just to add to the Additional Content field.
Maybe a bug? Not fully sure. I tend to use code for everything, even changing the settings!
Hi there,
Does anyone know how do I hide the supplier name from my customer’s email? I’ve purchased the dropshipping paid plug-in from Woo a few months ago however every time I send emails to my customers either notes or purchasing completed via Woo the information of my supplier is on the body of that email as part of the description of that order.
I will appreciate it if somebody can help me with that.
I can’t provide a link, but I can show you a screenshot of what the customers seeing on their emails.
Thanks for your time!
F
Hey Felipe, did you ask the plugin developer?
I just tested this snippet, and it’s not working for me. Does it need updating?
Not really, as gettext is a WordPress function. Are you translating the correct, full, complete strings?
Hi Rodolfo,
Thanks for this. Couple of queries.
1. I read somewhere that gettext is very resource intensive. Please share some thoughts on this. Will the above code make everything slow?
2. This code seems to look for the phrase everywhere. Is there something that can be added to restrict this translation to specific emails?
Thanks
It’s fine if not used too much 🙂 Also, you can pass the “textdomain” to the gettext function and e.g. only look for “woocommerce” strings. Hope this helps