Activating a single plugin via php

If you already have the plugin installed as part of the initial setup, you can add a loader for it in mu-plugins that activates it.

Must-use plugins don’t require activation themselves, so adding a call to activate_plugin() inside it will attempt to automatically activate your plugin on every load. That becomes a problem if you ever want to deactivate the plugin since it’ll just reactivate on the next page load, but one way around that is to remove the must-use plugin to enable deactivating the other one.

Leave a Comment