# Hide the ACF Menu on Production Sites

> Removes the Advanced Custom Fields menu on the live site so field groups can only be edited on development or staging, where changes are synced through JSON.

- Type: PHP
- Runs: Run everywhere
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: acf, admin, staging
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/acf-hide-admin-production/

## Code

```php
add_filter( 'acf/settings/show_admin', function ( $show ) {
    return 'production' === wp_get_environment_type() ? false : $show;
} );
```

## Notes

Set WP_ENVIRONMENT_TYPE to "staging" or "development" on other copies of the site. Fields keep working on production.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide the ACF Menu on Production 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/
