# Disable plugins by config

**URL:** <https://forum.getkirby.com/t/disable-plugins-by-config/3921>\
**Category:** Questions\
**Tags:** v2\
**Created:** [April 21, 2016, 7:09am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921 "2016-04-21T07:09:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 21, 2016, 7:09am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/1 "2016-04-21T07:09:49Z")

</div>

Maybe there is a problem with a plugin. You want to use it but need to disable it for some reason. To disable it you need to rename or move the plugin folder so Kirby can not use it.

I have another idea…

**Disable plugins by config**

One

```auto
c::set('kirby.disable.plugins', 'splitview');

```

Or many

```auto
c::set('kirby.disable.plugins', [
  'splitview',
  'seo',
  'pre-controller'
]);

```

In the long run it would be nice to disable things like `fields` and `tags` etc as well.

---

<div class="post-metadata">

**Author:** ![1n3JgKl9pQ6cUMrW](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/1n3jgkl9pq6cumrw/32/2368_2.png) [@1n3JgKl9pQ6cUMrW](https://forum.getkirby.com/u/1n3JgKl9pQ6cUMrW)\
**Post date:** [April 21, 2016, 10:26am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/2 "2016-04-21T10:26:44Z")

</div>

I simply disable them (during development, to avoid any artefact) by changing the folders-name;

`myplugin\myplugin.php` -\> works

`x myplugin\myplugin.php` -\> doesn’t work

when done, I remove the `x` and it’s working again 😛

* * *

**- edit -** Hmm… I can also create a simple widget on the dashboard that shows all plug-ins.

And you can disable / re-enable them from the widget on the same maner.

Will first work out my `image preview` plugin and than create this widget.

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 21, 2016, 11:09am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/3 "2016-04-21T11:09:02Z")

</div>

If I understand you correctly the widget would list the plugins and by choice deactivate it by renaming the folder to some prefix? Maybe add a `.` as prefix before the folder name. That should not collide with active plugins.

If that is what you mean, I think it’s an interesting idea. A good workaround.

I still think this suggestion is still relevant, because it can be done in a simple way even without a UI.

---

<div class="post-metadata">

**Author:** ![1n3JgKl9pQ6cUMrW](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/1n3jgkl9pq6cumrw/32/2368_2.png) [@1n3JgKl9pQ6cUMrW](https://forum.getkirby.com/u/1n3JgKl9pQ6cUMrW)\
**Post date:** [April 21, 2016, 11:30am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/4 "2016-04-21T11:30:45Z")

</div>

Yeah - adding a single dot `.` is a better solution.

Or something like `-1_foldername`.

 ![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/3/3ac75095227f35140de63ab578e7f0f55d07e040.png)

And I want to keep it simple, a bit like WordPress does - but without all the options.

Just toggle a plugin from active to inactive, and vice versa.

I think this can be done by plain .php and some ajax-functions.

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 21, 2016, 11:37am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/5 "2016-04-21T11:37:02Z")

</div>

Yes, it would be nice to have a panel widget for that.

Even if they implement my config suggestion you could still have your widget. It would still work and it would probably be easy to change it to the new syntax if you would want that.

---

<div class="post-metadata">

**Author:** ![jakobploens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jakobploens/32/1315_2.png) [@jakobploens](https://forum.getkirby.com/u/jakobploens)\
**Post date:** [April 21, 2016, 11:40am UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/6 "2016-04-21T11:40:49Z")

</div>

This might work, but I think plugins for Kirby are way different than plugins for Wordpress. There are a lot of plugins which are, once installed, not as easy to remove as just renaming the folder, because different parts of the site are totally dependent on them. When you are using for example the relative date plugin ([http://getkirby-plugins.com/relative-date](http://getkirby-plugins.com/relative-date)), using the function which is never defined would cause the site or certain pages to break. So one have to be really aware of what he or she is doing if deactivating plugins. For others, like auto publish or the MinifyHTML plugin, it would work of course.

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 21, 2016, 12:01pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/7 "2016-04-21T12:01:53Z")

</div>

Agree! That’s why I think my config suggestion is good for the core and the widget is good for a plugin. It would then be optional to add the widget, as it’s not a built in thing.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [April 21, 2016, 12:03pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/8 "2016-04-21T12:03:43Z")

</div>

I wouldn’t want to have a widget for this. As @jakobploens wrote, that’s just not compatible with how Kirby plugins work.

Jens, what is your use-case? Why do you need to disable plugins? Maybe we can find a better and simpler solution for that.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 21, 2016, 12:07pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/9 "2016-04-21T12:07:24Z")

</div>

To be honest, I don’t really see the use case for a widget; it just adds stuff to the panel that is not really helpful there (Wordpress, Joomla etc. way of adding bloat).

As regards the config setting, I’m not really sure that is needed either. Ok, the advantage to moving the plugin would be to keep it in place. But I don’t know if that use case is so important to have yet another setting in the config file.

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 21, 2016, 12:12pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/10 "2016-04-21T12:12:15Z")

</div>

Let’s say you have a problem with the site. You have 20 plugins and want to know which one that make the problems. Then it could be nice to, by code deactivate them instead of rename 20 folders.

I agree that the widget is not the Kirby way. For a plugin yes, but not for the core. I’m always very open minded about plugins because they never do any harm. I mean, you are never forced to install them. If you don’t like them, don’t use them.

@lukasbestle @texnixe

1. If you have 20 plugins installed and you have a problem with one of them and you don’t know which one, how do you disable them one by one? Rename all the folders?
2. If you temporarly want to deactivate a plugin, what do you do? Rename the folder?

Maybe my solution is not the best one, but I think the problem is real.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 21, 2016, 12:14pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/11 "2016-04-21T12:14:50Z")

</div>

I just throw the folder out. Much quicker than a config setting.

---

<div class="post-metadata">

**Author:** ![1n3JgKl9pQ6cUMrW](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/1n3jgkl9pq6cumrw/32/2368_2.png) [@1n3JgKl9pQ6cUMrW](https://forum.getkirby.com/u/1n3JgKl9pQ6cUMrW)\
**Post date:** [April 21, 2016, 12:36pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/12 "2016-04-21T12:36:41Z")

</div>

That’s the way I do it as well 😛

…or rename it temporary, in order to check for the results.

But when you’ve a plug-in that installs several folders, in several locations - throwing / renaming the “main” folder also causes issues (when the plug-in itself is not checking for it’s own integrity).

So the best way - for now - is a manual solution… and not installing too many plug-ins.

I only use minifier and cache-buster as default.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [April 21, 2016, 2:08pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/13 "2016-04-21T14:08:56Z")

</div>

When I see that some plugin is making problems, I move out all plugins and move them back in one by one. So that’s a similar strategy as @texnixe’s.

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [April 22, 2016, 2:02pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/14 "2016-04-22T14:02:13Z")

</div>

@lukasbestle @texnixe

I understand your point of view, but personally I work faster in the code editor than moving around folders.

That’s why… tadaaa, a new plugin!

## Kirby Unset Plugins

[https://github.com/jenstornell/kirby-unset-plugins](https://github.com/jenstornell/kirby-unset-plugins)

> [@Kirby Unset Plugins](https://forum.getkirby.com/t/kirby-unset-plugins/3934):
>
> We had a discussion about a way to [deactivate/unset plugins](https://forum.getkirby.com/t/disable-plugins-by-config/3921) by a config value. It was not a very popular topic, as not that many agreed with me. But I’m quite stubborn so I made it possible anyway. Kirby Unset Plugins [https://github.com/jenstornell/kirby-unset-plugins](https://github.com/jenstornell/kirby-unset-plugins) As string: c::set('plugin.unset.plugins', 'splitview'); As array: c::set('plugin.unset.plugins', ['pre-controller', 'revisions', 'splitview']); Maybe a strange option key, but at least it will probably not collide wi…

---

<div class="post-metadata">

**Author:** ![jenstornell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jenstornell/32/546_2.png) [@jenstornell](https://forum.getkirby.com/u/jenstornell)\
**Post date:** [June 27, 2017, 1:11pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/15 "2017-06-27T13:11:07Z")

</div>

I want to wake this up old topic again. I still vote for a config to disable plugins of choice.

> [@Disable plugin on localhost](https://forum.getkirby.com/t/disable-plugin-on-localhost/7817/):
>
> Hello, is it possible to disable a plugin on a localhost dev server? i’ll try this plugin: [GitHub - getkirby-v2/cdn-plugin](https://github.com/getkirby-plugins/cdn-plugin) But it would not work on localhost i think. Svnt

A new take on why it can be beneficial is that different environments may have different needs.

## An example

### `config.localhost.php`

```php
c::set('kirby.disable.plugins', ['kirby-html-minifier', 'kirby-ga']); 

```

### `config.yourdomain.com.php`

```php
c::set('kirby.disable.plugins', ['kirby-panel-brand']); 

```

**Benefits**

- For two of the plugins, I’ve built in an option to disable them already. Unfortunately, far from all plugins a disable feature.
- In the `config.php`, It’s much simpler to have one option to control all the plugins, than having a unique config for every plugin that supports disabling.
- Imagine 300+ plugins with the support for a disable option. Compare the extra code and work to if it was done in the core 1 time.

**Sources:**

- [GitHub - kirby-deprecated-plugins/kirby-ga: Kirby GA - Google Analytics](https://github.com/jenstornell/kirby-ga)
- [GitHub - kirby-deprecated-plugins/kirby-html-minifier: Minify the html output of a site built with Kirby CMS](https://github.com/jenstornell/kirby-html-minifier)
- [GitHub - flokosiol/kirby-panel-brand: Possible to add a color and a text at the top of the Kirby Panel](https://github.com/jenstornell/kirby-panel-brand)

---

<div class="post-metadata">

**Author:** ![tobystokes](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/tobystokes/32/745_2.png) [@tobystokes](https://forum.getkirby.com/u/tobystokes)\
**Post date:** [August 4, 2017, 5:04pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/16 "2017-08-04T17:04:59Z")

</div>

fwiw, this is pretty much the use case I’m looking to solve too - there are several plugins that I do not want to run in local dev, but do want in production

---

<div class="post-metadata">

**Author:** ![JanStieler](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/janstieler/32/15642_2.png) [@JanStieler](https://forum.getkirby.com/u/JanStieler)\
**Post date:** [September 12, 2017, 10:08pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/17 "2017-09-12T22:08:15Z")

</div>

Hi @jenstornell, where can I find your KirbyPlugin **Kirby Unset Plugins**?  
The Github link will not work actually.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 12, 2017, 10:20pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/18 "2017-09-12T22:20:07Z")

</div>

[https://github.com/jenstornell/kirby-plugins/issues/245](https://github.com/jenstornell/kirby-plugins/issues/245)

Note that the alternative is no longer developed, either.

[This plugin](https://github.com/jenstornell/kirby-plugin-installer) can also be used to deactivate plugins (I personally think it’s not such a good idea to deactivate plugins via the Panel as it might easily break your site, but obviously, other people think differently about this).

---

<div class="post-metadata">

**Author:** ![JanStieler](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/janstieler/32/15642_2.png) [@JanStieler](https://forum.getkirby.com/u/JanStieler)\
**Post date:** [September 13, 2017, 3:38pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/19 "2017-09-13T15:38:02Z")

</div>

Thank you @texnixe.

I personally think it’s not such a good idea to deactivate plugins via the Panel as it might easily break your site, but obviously, other people think differently about this  
I can comprehend this but I have some Plugins like SASS which I need only on my development environment. And if you restrict a function like this to an admin it should be okay, as I think.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 13, 2017, 3:55pm UTC](https://forum.getkirby.com/t/disable-plugins-by-config/3921/20 "2017-09-13T15:55:11Z")

</div>

> [@JanStieler](#):
>
> but I have some Plugins like SASS

Yes, this makes sense. But if you use field plugins or anything that is used in your templates or controllers, the Panel or your site will break if you don’t remove the fields/code from your blueprints/templates/controllers/plugins…

[Next page](https://forum.getkirby.com/t/disable-plugins-by-config/3921.md?page=2)
