Skip to content

WordPress with Composer — when it's worth the switch

Managing WordPress with Composer pays off above a portfolio threshold. The honest decision tree on when to convert a WordPress site to Composer-managed and when to leave it alone.

A junior dev reads about Bedrock and asks why every WordPress site doesn’t use Composer. A senior operator answers honestly: most don’t, and that’s correct. Composer-managed WordPress shines under a specific set of conditions and adds friction outside of them. The decision tree matters more than the syntax.

What’s happening

A stock WordPress install puts plugins, themes, and core into the same tree the dashboard writes to. Composer-managed WordPress (typically via the Bedrock layout from Roots, or a hand-rolled composer.json with the WordPress Packagist mirror) treats plugins and core as dependencies — fetched at build time, pinned in composer.lock, never committed to Git. Updates become a composer update vendor/plugin && composer.lock commit and a pipeline deploy.

The benefits compound with scale. One site has nothing to gain. Forty sites with the same plugin set across them gain everything: atomic security upgrades, lockfile-driven version answers, no plugin code in Git, and the same deploy story as every other PHP application.

The costs are real too. Composer assumes a build step. The customer’s marketing team can’t install a plugin via wp-admin anymore. License-protected premium plugins (ACF Pro, Gravity Forms, WP Migrate) need a token-authed Composer repository, not just a download. And the team needs to know what a lockfile is.

How to verify

For an existing site, the question is whether the plugin list is large, varied, and updated frequently. Inventory it:

wp plugin list --fields=name,version,update,status --format=csv > plugins.csv
wp theme list --fields=name,version,update --format=csv > themes.csv
wc -l plugins.csv themes.csv

If the plugin count is under 10 and three are commercial without Composer mirror support, conversion is not free. If the count is 25, all from WordPress.org, and the site is one of many in a portfolio, conversion pays back in weeks.

Check whether your premium plugins are Composer-installable:

# Most Delicious Brains plugins
curl -sI https://composer.deliciousbrains.com
# ACF Pro via wpackagist? No — needs private repo via composer.advancedcustomfields.com
# Gravity Forms? Their own composer repo, needs license token

If three of the must-have plugins don’t have Composer paths, that’s three private repositories to maintain — possible, but adds setup time.

What to do

Use the decision tree.

  1. Single WordPress site, no portfolio. Skip Composer. The maintenance overhead doesn’t pay back. Keep wp-content/plugins/ in Git if you want change history, or just take Soft Backups and trust the dashboard.

  2. Two to five WordPress sites for the same team, same hosting. Borderline. Composer helps if you’re rotating staff and want every site to look the same; skip it if the team is stable and the sites genuinely differ.

  3. Portfolio of 10+ WordPress sites, same agency. Convert. The CVE triage benefit alone justifies the migration. grep -r "elementor/elementor" */composer.lock | grep "3.21.4" is the answer you cannot get from a non-Composer portfolio.

  4. Custom plugin development inside the agency. Convert. Composer is the right packaging story for in-house plugins — publish to a private Packagist instance, version them with semver, consume them like any other dependency.

  5. WooCommerce store with a marketing team that installs plugins through wp-admin. Don’t convert. The conversion takes plugin installation away from the people who do it. If you must, set up a parallel “staging” environment they can install into, and have engineering review the diff before promoting.

  6. Headless WordPress (front-end is a JavaScript app). Convert. The headless front-end already has a package.json and a build step — the WordPress half should match.

The minimal composer.json for a single-site conversion (not full Bedrock):

{
    "name": "client/wp-site",
    "type": "project",
    "config": { "allow-plugins": { "composer/installers": true } },
    "repositories": [
        { "type": "composer", "url": "https://wpackagist.org" }
    ],
    "require": {
        "composer/installers": "^2.0",
        "wpackagist-plugin/wordpress-seo": "^22.0",
        "wpackagist-plugin/wp-mail-smtp": "^4.0"
    },
    "extra": {
        "installer-paths": {
            "wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
        }
    }
}

That alone moves plugin installation to composer install without changing the directory layout. Bedrock is the next level up — see Bedrock + Composer for agencies for the full layout.

Stack Harbor converts agency portfolios under Enterprise WordPress. If a team is on the threshold and unsure whether conversion pays back, we can scope the migration.