How can I disable a plugin


  • GNU/Linux

    I need to disable a plugin from the code and not from the GUI. Anyone can show how I can do this?


  • Community Rep

    Call toggle active then restart or reload nodebb.

    var Plugins = require.main.require('./src/plugins');
    var Meta = require.main.require('./src/meta');
    var pluginid = 'nodebb-plugin-yourplugin';
    
    Plugins.isActive(pluginid, function (err, isActive) {
      if (err) return console.log(err);
      if (isActive) Plugins.toggleActive(pluginid, Meta.restart); // or Meta.reload
    })
    

Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.