Roots Discourse

Deploy own themes and plugins, but don't overwrite other plugins/themes that are installed through WP Admin dashboard

Normally I like the way Bedrock has all themes and plugins in Composer, but I have some smaller clients that I host on a small DO droplet that I run with Trellis. Updating their plugins and themes is a bit of a pain with Composer, and I am looking if there’s a possibility to update them in the WP admin directly (or through something like ManageWP).

By setting Config::define('DISALLOW_FILE_MODS', false); in /config/environments/production.php I’ve enabled the option to install plugins and themes through the WordPress admin dashboard, but whenever I deploy my custom theme or plugin, it will overwrite any plugins or themes I’ve installed through the WordPress admin dashboard.

I found a thread that gives a solution to this problem by excluding the themes and/or plugins folders from the release, but if I add plugins and themes to project_shared_children, my own themes and plugins don’t get deployed.

Is there any way to deploy my themes/plugins and not manage the other plugins through Composer?

I’m not sure you can have the best of both worlds here. If you want to be able to update a plugin via the Admin, the easiest way to achieve that is to remove it from composer.json. Then when you deploy it won’t be overridden?

Thanks @swalkinshaw, I thought that wouldn’t work, so I just tried it again. So this is what I’m doing:

  1. I have a composer.json that installs the WP Migrate DB Pro plugin and a couple of add-ons. Otherwise I don’t have any plugins in composer.json.
  2. I install some plugins on the server with WP CLI
  3. I run ./bin/deploy production sitename
  4. I check my production server and the plugins I’ve installed through WP CLI are no longer there

If I understand you correctly, I should expect the plugins I’ve installed through WP CLI to still be there, or am I missing something?

This topic was automatically closed after 42 days. New replies are no longer allowed.