# Adding server-side plugin disabling to safe mode

**URL:** <https://meta.discourse.org/t/adding-server-side-plugin-disabling-to-safe-mode/148299>\
**Category:** Development\
**Created:** [April 17, 2020, 12:04am UTC](https://meta.discourse.org/t/adding-server-side-plugin-disabling-to-safe-mode/148299 "2020-04-17T00:04:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [April 17, 2020, 12:04am UTC](https://meta.discourse.org/t/adding-server-side-plugin-disabling-to-safe-mode/148299/1 "2020-04-17T00:04:15Z")

</div>

I find that folks often first try [safe mode](https://meta.discourse.org/t/53504?silent=true) whenever anything breaks and they’re using 3rd party customisations. This makes sense. You don’t know where the issue is coming from.

However, [safe mode](https://meta.discourse.org/t/53504?silent=true) only disables javascript. If there’s any server-side code, typically the immediate solution is to un-comment all plugins in the app.yml file. That’s fine, however it requires a rebuild and is relatively ‘technical’. If you’re a non-technical user, commenting out stuff in the app.yml is not something you take to lightly.

I’m wondering about the viability of a PR that adds in server-side plugin disabling in [safe mode](https://meta.discourse.org/t/53504?silent=true). I’m thinking something along the lines of this in the safe-mode controller.

```plaintext
find_opts = {
  include_official: params["only_official"] != 'true',
  include_unofficial: params["no_plugins"] == "true"
}
      
Discourse.find_plugins(find_opts).each do |plugin|
  if plugin.enabled_site_setting.present?
    SiteSetting.set(plugin.enabled_site_setting, false)
  end
end

```

Yes, the same effect could be achieved by the user going through their site settings and switching the plugins off that way, however I find that users rarely actually do this.

---

_[View the full topic](https://meta.discourse.org/t/adding-server-side-plugin-disabling-to-safe-mode/148299)._
