WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to stop all email functionality in my wordpress installation.

Is this possible with a global flag?

or maybe by forbidding this installation to use the php mail function at all in htaccess?

share|improve this question

Please refer below link. It will may help you.


share|improve this answer

Below function is less offensive than overriding wp_mail(), and allows you to add extra logic when the emails should be disabled

function childtheme_no_emails( &$phpmailer ) {
    // Empty out the values that may be set
add_action( 'phpmailer_init', 'childtheme_no_emails', 99, 1 );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.