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.
/public, /storage, /vendor) is fundamentally different from WordPress’s wp-content isolation needs. This package assumes a WordPress-centric filesystem layout, which conflicts with Laravel’s conventions.vendor/, composer.json, and autoload. The package’s primary feature (custom wp-content paths) is redundant if using Laravel’s storage/ or cloud storage (e.g., S3)./wp) and not tightly integrated with Laravel’s routing, middleware, or service container. For full-stack Laravel-WP hybrids, alternatives like bedrock or wp-php are more robust.composer.json already manages dependencies without needing WordPress-specific installers. The package’s core logic (symlinking wp-content, customizing WP_CONFIG) is irrelevant unless:
/wp).wp-content (e.g., for plugins/themes).vendor/composer/autoload.php may conflict with WordPress’s wp-includes/load.php if both are in the same project root.bootstrap/app.php vs. WordPress’s wp-load.php).wordpress-core), which could interfere with Laravel’s laravel/installer or spatie/laravel-package-tools.vendor/ structure.config/ overrides (e.g., APP_URL, ASSET_URL).composer update could break Laravel’s autoloader if WordPress dependencies conflict.wp-config.php adjustments (e.g., ABSPATH, WP_CONTENT_URL).wp-cli for updates.spatie/laravel-wordpress or tighten/laravel-wordpress for tighter integration.vendor/ and WordPress’s wp-content coexist without conflicts?wp-content be version-controlled or managed separately?composer install interact with Laravel’s optimize or wp-cli commands?trustedproxies, csrf)?wp-content introduce race conditions during Laravel migrations or WordPress updates?/public, /storage, /vendor; WordPress expects /wp-content, /wp-admin.composer.json is self-contained; this package assumes WordPress is a "first-class citizen."routes/web.php and WordPress’s wp-includes/rewrite.php cannot coexist without custom logic./wp, use Laravel to serve a Vue/React frontend./wp, use Laravel for new features.wp-content for Plugins/Themes (e.g., using Laravel’s storage/ as WP_CONTENT_DIR).
storage/app/wp-content to WordPress’s wp-content.composer why-not johnpbloch/wordpress-core-installer to check for conflicts.spatie/laravel-wordpress) don’t overlap./wp directory outside Laravel’s /public.composer require johnpbloch/wordpress-core-installer --dev
composer require wordpress/wordpress:^6.0 --type wordpress-core
wp-config.php:
define('WP_CONTENT_DIR', storage_path('app/wp-content'));
define('WP_CONTENT_URL', asset('wp-content'));
routes/web.php:
Route::prefix('wp')->group(function () {
require __DIR__ . '/wp/wp-blog-header.php';
});
mix.js()/mix.css()).wp_enqueue_script() for dynamic assets.WordPressServiceProvider to bootstrap WordPress conditionally:
if (!app()->runningInConsole()) {
require __DIR__ . '/wp/wp-load.php';
}
composer update johnpbloch/wordpress-core-installer wordpress/wordpress
php artisan optimize:clear
storage/app/wp-content is correctly linked and writable.wp-cli for database setup (e.g., wp core install).php artisan config:cache).| Component | Risk Level | Mitigation |
|---|---|---|
| Composer v2 | Medium | Test with "config": { "platform-check": false } in composer.json. |
| PHP 8.x | High | Use platform.php or polyfills for deprecated functions. |
| Laravel 10+ | High | Patch this package or fork it for Laravel-specific fixes. |
| ** |
How can I help you explore Laravel packages today?