[Contact Widget] Is it possible to block certain email addresses?

I get a lot of spam messages through my contact form and I was wondering if there is any product is available which can block these addresses?

  • Ash
    • WordPress Hacker

    Hello Baudina

    I am afraid, this is not possible out of the box. You have to customize the plugin to achieve that.

    You can go to /contact-form/scripts/ajax.php line no 134, there you can set a condition to check the “from” email address and then send the email.

    For example:

    if( $from != 'abc@xyz.com' ) {
    $mail = wp_mail( $admin_email, $subject, $message, $headers );

    Hope it helps! Have a nice day :slight_smile:



Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.