# Don't Email Submissions of Certain Contact Form 7 Forms

> Stops Contact Form 7 sending emails for the forms you list while still showing the success message, useful when submissions are saved or sent to a CRM instead.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: contact-form-7, notifications, email
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/cf7-skip-mail-for-forms/

## Code

```php
$wpide_cf7_no_mail_forms = array(); // Form IDs that should not send email, e.g. array( 123, 456 ).

add_filter( 'wpcf7_skip_mail', function ( $skip, $contact_form = null ) use ( $wpide_cf7_no_mail_forms ) {
    if ( $contact_form && in_array( (int) $contact_form->id(), array_map( 'intval', $wpide_cf7_no_mail_forms ), true ) ) {
        return true;
    }

    return $skip;
}, 10, 2 );
```

## Notes

Add the form IDs at the top and pair it with a snippet that saves submissions or sends them to a webhook, otherwise the messages are lost.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Don't Email Submissions of Certain Contact Form 7 Forms" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
