WP Manifestindependent plugin directory
manifest / developer / fd-disable-local-plugins

FD Disable Local Plugins

Disable local WordPress plugins depending on the environment, e.g., local, development, staging, production

★ 1stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/heyfletch/fd-disable-local-plugins/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Disable Local Plugins

Disable local plugins depending on the environment, e.g., local, development, staging, production.

Place this plugin (fd-disable-local-plugins.php & fd-disable-local-plugins subdirectory only) in your mu-plugins directory.

In wp-config.php (or local-config.php or config/environments for Bedrock), add:

// Disable on this environment only (be sure to install mu-plugin):
define('LOCAL_DISABLED_PLUGINS', serialize([
  'autoptimize/autoptimize.php',
  'redis-cache/redis-cache.php',
  'google-site-kit/google-site-kit.php',
  'google-analytics-for-wordpress/googleanalytics.php',
  'limit-login-attempts-reloaded/limit-login-attempts-reloaded.php',
  'cloudflare/cloudflare.php',
  'cloudguard/cloudguard.php',
  'sunny/sunny.php',
  'worker/init.php',
]));

TODO

Don't push active plugin options during WP Migrate DB Pro Push? Or, maybe not needed if this plugin does not change the settings in the options, just overrides them via wp-config.php. TBD.

Remove Site Health Check's "You should remove inactive plugins" recommendation.

Credit

Kamil Grzegorczyk for the blog post and code that this plugin is based on.