PHPackages                             lukasbesch/disable-plugins - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lukasbesch/disable-plugins

Abandoned → [lukasbesch/bedrock-plugin-disabler](/?search=lukasbesch%2Fbedrock-plugin-disabler)Wordpress-muplugin[Utility &amp; Helpers](/categories/utility)

lukasbesch/disable-plugins
==========================

Disable certain plugins in non-production environments using PHP constants.

v1.5.0(3mo ago)54167[1 PRs](https://github.com/lukasbesch/bedrock-plugin-disabler/pulls)MITPHPPHP &gt;=7.2CI passing

Since Nov 26Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/lukasbesch/bedrock-plugin-disabler)[ Packagist](https://packagist.org/packages/lukasbesch/disable-plugins)[ RSS](/packages/lukasbesch-disable-plugins/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (2)Versions (14)Used By (0)

Bedrock Plugin Disabler
=======================

[](#bedrock-plugin-disabler)

[![Packagist](https://camo.githubusercontent.com/613529eaf1b30f14b8176f75e66c6dea466b1a15b886ef50e23dfbd2da18a019/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6c756b617362657363682f626564726f636b2d706c7567696e2d64697361626c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukasbesch/bedrock-plugin-disabler)[![Supported PHP Versions](https://camo.githubusercontent.com/3a4d2154a80455ed041843acabc115dbbab54bf73d95dc8eea422058b65ef43f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c756b617362657363682f626564726f636b2d706c7567696e2d64697361626c65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/lukasbesch/bedrock-plugin-disabler)[![GitHub Repository Size](https://camo.githubusercontent.com/2c17c5dcc44444bd450174deade16c3195296ba44163d38caba6b8d05533aab3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6c756b617362657363682f626564726f636b2d706c7567696e2d64697361626c65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/lukasbesch/bedrock-plugin-disabler)[![Build Status](https://camo.githubusercontent.com/57505618c00e53db963643a54f8d6384da71c1b4c8c5558c81f04d7a483e66be/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f6769746875622f6c756b617362657363682f626564726f636b2d706c7567696e2d64697361626c65723f7374796c653d666c61742d737175617265)](https://circleci.com/gh/lukasbesch/bedrock-plugin-disabler)[![Downloads](https://camo.githubusercontent.com/d6df94ad61c73732542ee5081d3b1f04898c547ad20b652d42e5993bbc296538/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756b617362657363682f626564726f636b2d706c7567696e2d64697361626c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukasbesch/bedrock-plugin-disabler)

Define an array of plugins that deactivate automatically in certain environments (e.g. caching plugins in development).

Inspired by [this blog post](https://kamilgrzegorczyk.com/2018/05/02/how-to-disable-plugins-on-certain-environment/) by [Kamil Grzegorczyk](https://kamilgrzegorczyk.com/). Uses [a fork](https://gist.github.com/Rarst/4402927) of the [`DisablePlugins` class](https://gist.github.com/markjaquith/1044546) written by [Mark Jaquith](http://markjaquith.com/).

Installation
------------

[](#installation)

This plugin is designed to work with [Bedrock](https://github.com/roots/bedrock) based sites, and will **not** work with a Standard WordPress installation.

```
$ composer require lukasbesch/bedrock-plugin-disabler
```

It will be installed as a `wordpress-muplugin`.
If you try to activate it as a regular plugin, the plugin will deactivate itself with a notice.

#### Manual Installation (not recommended)

[](#manual-installation-not-recommended)

Download [the latest release](https://github.com/lukasbesch/bedrock-plugin-disabler/releases/latest) and place it in your `web/app/mu-plugins` folder.

Usage
-----

[](#usage)

Define the constant `DISABLED_PLUGINS` with an array of the plugins main files you want to deactivate in your preferred environment configuration, for example `config/environments/development.php`:

```
Config::define('DISABLED_PLUGINS', [
    'autoptimize/autoptimize.php',
    'updraftplus/updraftplus.php',
    'wp-super-cache/wp-cache.php',
    'w3-total-cache/w3-total-cache.php',
]);
```

If you have an older Bedrock installation ([&lt; 1.9.0](https://github.com/roots/bedrock/releases/tag/1.9.0)) you have to define the constant using the regular `define()` function:

```
if (! defined('DISABLED_PLUGINS')
    define('DISABLED_PLUGINS', [
        'autoptimize/autoptimize.php',
    ]);
}
```

You can also provide serialized data:

```
Config::define('DISABLED_PLUGINS', serialize([
    'autoptimize/autoptimize.php',
]));
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance81

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 84.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~283 days

Recently: every ~377 days

Total

9

Last Release

101d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.6

v1.5.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb69c0703a9baffb8c589acac013698f8dac0b19a4778e0d41625e1547e07cda?d=identicon)[lukasbesch](/maintainers/lukasbesch)

---

Top Contributors

[![lukasbesch](https://avatars.githubusercontent.com/u/241689?v=4)](https://github.com/lukasbesch "lukasbesch (37 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![ethanclevenger91](https://avatars.githubusercontent.com/u/2623646?v=4)](https://github.com/ethanclevenger91 "ethanclevenger91 (1 commits)")[![ikiselev1989](https://avatars.githubusercontent.com/u/22061871?v=4)](https://github.com/ikiselev1989 "ikiselev1989 (1 commits)")[![vegetable-bits](https://avatars.githubusercontent.com/u/209451539?v=4)](https://github.com/vegetable-bits "vegetable-bits (1 commits)")

---

Tags

bedrockmu-pluginwordpress-plugin

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lukasbesch-disable-plugins/health.svg)

```
[![Health](https://phpackages.com/badges/lukasbesch-disable-plugins/health.svg)](https://phpackages.com/packages/lukasbesch-disable-plugins)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
