## How To Activate Plugins via Code?

Question

If possible, how can installed plugins (meaning the files have been placed in wp-content/plugins directory) be activated from other plugins?

in progress 0
12 years 2010-11-14T06:24:24-05:00 0 Answer 116 views 0

It is handled by activate_plugin() function (source) which is documented as unusable elsewhere.
So if you want to activate plugin by code the goal itself is relatively easy – to change active_plugins option to include that plugin. But you will have to re-create related activation hooks from scratch and will risk breaking site by activating without sandbox step.