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?


Please refer below link. It will may help you.



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 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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