johnpbloch/wordpress-core-installer
Composer plugin that installs WordPress core outside vendor, designed for setups with WordPress in a subdirectory and wp-content moved elsewhere to avoid updates wiping content. Supports custom install paths via wordpress-install-dir.
wordpress-core-installer:^5.0).wp-content: Prevent accidental deletions during updates, critical for agency workflows where plugins/themes are client-specific.composer.json with type: wordpress-core).Adopt if:
vendor/ (e.g., /var/www/wordpress) with wp-content in a separate directory (e.g., /var/www/wp-content).wp-content outside the core directory to avoid update-related data loss (see WordPress Codex).Look elsewhere if:
wp-php or alternatives like bedrock).wp-cli or wp-env for full-stack management).*"This package lets us treat WordPress like a Composer dependency—just like our Laravel packages—so our team can deploy WordPress sites consistently and automatically. No more manual downloads or broken updates wiping out plugins. It’s especially valuable for [agency projects/headless WordPress APIs], where we need to isolate core updates from custom content.
Key Benefits:
composer install (saves 10–20 hours/year per developer).Example: If we’re building a Laravel + WordPress hybrid app, this package ensures WordPress core updates are controlled and reproducible, while Laravel handles the frontend. Think of it as ‘npm for WordPress’—version-controlled, reproducible, and scalable."*
*"This solves two critical pain points:
johnpbloch/wordpress-core-installer:^5.0) alongside Laravel packages.wp-content on updates. This package lets us move wp-content outside the core directory, so updates are clean and non-destructive.How to Use It:
composer.json:
"require": {
"johnpbloch/wordpress-core-installer": "^1.0"
},
"extra": {
"installer-paths": {
"wp/": ["type:wordpress-core-installer"]
}
}
wp-config.php to point WP_CONTENT_DIR to a custom location (e.g., /var/www/wp-content).composer install—WordPress core installs outside vendor/, and wp-content stays intact.Alternatives Considered:
Risks:
wp-cli db export/import for full-stack backups.Recommendation: Pilot this for one WordPress + Laravel hybrid project to validate the workflow before wider adoption. If successful, we can standardize it across all WordPress deployments."*
*"If you’re tired of manually downloading WordPress or dealing with broken updates that wipe out wp-content, this package is a game-changer. It lets you manage WordPress core via Composer, just like any other PHP library.
Why It’s Useful:
wp-content deletions: The package moves wp-content outside the core directory, so updates are safe.5.8) just like Laravel packages.Setup:
composer.json:
"require": {
"johnpbloch/wordpress-core-installer": "^1.0"
},
"extra": {
"wordpress-install-dir": "wp"
}
wp-config.php to point WP_CONTENT_DIR to a custom folder (e.g., storage/app/wp-content).composer install—done!Pro Tip: Pair this with Laravel’s Artisan commands to automate WordPress migrations or plugin activations.
Caveats:
wp-cli alongside this.Try it on a side project first!"*
How can I help you explore Laravel packages today?