The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Contact Form 7 Honeypot
[resolved] Error message (4 posts)

  1. gijsgg
    Posted 2 years ago #

    The error message in the plugin is set to show the #Submission was referred to as spam wpcf7_get_message( 'spam' ) but when i filled the honeypot i get the message filled at: #Validation errors occurred.


  2. Ryan
    Plugin Author

    Posted 2 years ago #

    This has to do with how CF7 handles validation errors and how I *think* error notification should be handled with a honeypot.

    In CF7, validation errors are handled on a field-by-field basis. So the message set in the HP plugin is equivalent to the "Please fill the required field." validation notification that would appear if you try to submit a form with required fields that are empty.

    If any fields fail to validate, the "Validation errors occurred" error appears at the bottom of the form.

    There may be a way for a CF7 plugin (or "module", as they're called internally to CF7) to override the main form error/success message, but I'm unsure if it is possible, and also if it would be wise -- as it could override other messages set by other elements of CF7.


    It's by design, but I'm open to code suggestions on how to improve it.

  3. gijsgg
    Posted 2 years ago #

    Then can you explain what $result['reason'][$name] does in:

    if ( $value != '' ) {
    	$result['valid'] = false;
    	$result['reason'][$name] = wpcf7_get_message( 'spam' );


  4. Ryan
    Plugin Author

    Posted 2 years ago #

    Pretty much nothing. If we wanted to display a validation error under the field (i.e. "Please fill the required field."), that's where we would set it. But as the field is hidden, and as letting robots know that they need to fix that field is probably a bad idea, it's useless.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Honeypot
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.