OSTBear
OSTBear

Reputation: 31

disable spam filter contact form 7

I have a contact form on a website I'm working on. We're using Contact Form 7 and I've run into a snag. They use the form to register campers and a single user might fill out a form 3 or 4 times with several pieces of information being identical to what was already uploaded.

The Spam filter frequently tags forms as Spam and my client wants me to disable the spam filter on this altogether.

How do I do this? I have deleted akismet, I'm using Re-Captcha as a system to verify people and it still blocks forms as spam.

Any help would be appreciated.

Upvotes: 3

Views: 7819

Answers (5)

Maulik patel
Maulik patel

Reputation: 2436

add_filter('wpcf7_spam', '__return_false');

Upvotes: 0

Kostiantyn Petlia
Kostiantyn Petlia

Reputation: 145

The WPCF7_Submission class has private function spam() and the method checks data for spam. If we look at it we will see the correct way to skip it:

add_filter( 'wpcf7_skip_spam_check', '__return_true', 20, 2 );

Note, that there are 3 filters, and each of them checks for spam:

add_filter( 'wpcf7_spam', 'wpcf7_recaptcha_verify_response', 9, 2 );
add_filter( 'wpcf7_spam', 'wpcf7_akismet', 10, 2 );
add_filter( 'wpcf7_spam', 'wpcf7_disallowed_list', 10, 2 );

So, you can disable a part of the spam-checking functionality.

Upvotes: 0

Sarah
Sarah

Reputation: 56

The WordPress default CONFIG -> DISCUSSION is applying the disallowed words list to the CF7 forms.

To fix this try adding this code snippet to your theme functions.php file:

/**
 * CONTACT FORM 7
 * Disable WP Disallowed List for SPAM validation
 */
add_filter( 'wpcf7_submission_has_disallowed_words', '__return_false', 10, 2 );

It worked for me.

Upvotes: 1

Andrey Butorin
Andrey Butorin

Reputation: 61

I faced the same issue while developing. To solve it I added the code below to the functions.php file in the theme directory:

    add_filter('wpcf7_spam', function() { return false; });

wpcf7_spam - Form 7 hook which allows you to change spam check result. Probably it's not a good idea to leave this code on production:)

Upvotes: 6

IqbalBary
IqbalBary

Reputation: 1126

There is no filter on Contact Form 7. May be, you are using external plugin for spam control like Honeypot or your hosting/server making it spam. Possibility is, your hosting/server marks the email as spam. So disable any spam filter of your hosting or contact with your hosting admin.

Upvotes: -1

Related Questions