# Stop Gravity Forms Notifications on Staging Sites

> Turns off all Gravity Forms email notifications when the site is not the production environment, so tests on staging never email clients or your team.

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

## Code

```php
add_filter( 'gform_disable_notification', function ( $disabled ) {
    return 'production' !== wp_get_environment_type() ? true : $disabled;
} );
```

## Notes

Uses the WP_ENVIRONMENT_TYPE setting; set it to staging, development or local in wp-config.php on copies of the site.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Stop Gravity Forms Notifications on Staging Sites" 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/
