# Turn On the Gravity Forms Honeypot for Every Form

> Switches on Gravity Forms' built-in anti-spam honeypot for all forms, including ones created later, so nobody has to remember the setting.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: gravity-forms, spam, honeypot
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/gf-honeypot-all-forms/

## Code

```php
$wpide_gf_honeypot_skip = array(); // Form IDs to leave alone.

add_filter( 'gform_form_post_get_meta', function ( $form ) use ( $wpide_gf_honeypot_skip ) {
    if ( is_array( $form ) && ! in_array( (int) rgar( $form, 'id' ), array_map( 'intval', $wpide_gf_honeypot_skip ), true ) ) {
        $form['enableHoneypot'] = true;
    }

    return $form;
} );
```

## Notes

Exclude a form by adding its ID to the list at the top.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn On the Gravity Forms Honeypot for Every Form" 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/
