I am developing a plugin for craft 3 and the plugin just got published to the store.

I can browse through the store and install the plugin but it stays disabled. The user will have to goto Settings -> Plugins and then manually enable the plugin even after installing. Is there a way to auto enable the plugin after install?


1 Answer 1


It's because the plugin is doing this in the init():


That's basically overwriting Craft's default Project Config settings for a plugin (which is to be enabled).


If you keep it there, then you'll have to explicitly set it to enabled in Project Config as well, but ideally, you'll want to move that logic out of init() and into something like an EVENT_AFTER_INSTALL_PLUGIN event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.