https://github.com/wp-spaghetti/wp-boot
WP Boot is a lightweight Composer-based WordPress management system designed for scenarios where you need to manage an existing WordPress installation without restructuring its directory layout
https://github.com/wp-spaghetti/wp-boot
bedrock wordplate wordpress wpstarter
Last synced: about 1 month ago
JSON representation
WP Boot is a lightweight Composer-based WordPress management system designed for scenarios where you need to manage an existing WordPress installation without restructuring its directory layout
- Host: GitHub
- URL: https://github.com/wp-spaghetti/wp-boot
- Owner: wp-spaghetti
- License: gpl-3.0
- Created: 2025-12-21T16:26:03.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-03-26T23:20:24.000Z (3 months ago)
- Last Synced: 2026-04-03T02:19:22.305Z (2 months ago)
- Topics: bedrock, wordplate, wordpress, wpstarter
- Language: PHP
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README









# WP Boot
**WP Boot** is a lightweight Composer-based WordPress management system designed for scenarios where you need to manage an existing WordPress installation without restructuring its directory layout.
## Requirements
- PHP >= 8.1
- Composer
- **rsync** - Used to sync WordPress core files from vendor to public directory
## Why WP Boot?
While robust solutions like [Bedrock](https://roots.io/bedrock/), [WP Starter](https://github.com/wecodemore/wpstarter), and [Wordplate](https://github.com/vinkla/wordplate) offer excellent WordPress management through Composer, they typically require significant structural changes to the WordPress directory layout.
WP Boot was created for situations where:
- You're working with an **existing WordPress installation** that cannot be heavily modified
- You need to **version control** an already-deployed WordPress site
- You want to **dockerize** a traditional WordPress setup without restructuring
- You need a quick, minimal-impact solution for dependency management
## How It Works
WP Boot uses **rsync** to synchronize WordPress core files from the Composer vendor directory to your public directory, keeping the standard WordPress structure intact.
It only modifies the `wp-config.php` file, adding a simple bootstrap block:
```php
// BEGIN WP Boot - Do not remove this block
// @see https://github.com/wp-spaghetti/wp-boot
use function Env\env;
require_once dirname(__DIR__).'/private/wp-boot/bootstrap.php';
// END WP Boot - Do not remove this block
define('DB_NAME', env('DB_NAME'));
define('DB_USER', env('DB_USER'));
define('DB_PASSWORD', env('DB_PASSWORD'));
define('DB_HOST', env('DB_HOST'));
```
This approach allows you to:
- Manage WordPress core, plugins, and themes via Composer
- Use environment variables for configuration (`.env` files)
- Keep the standard WordPress directory structure intact
## Installation
```bash
composer create-project wp-spaghetti/wp-boot private/wp-boot
cd private/wp-boot
cp .env.dist .env
# Edit .env with your configuration
# IMPORTANT: Set WP_BOOT_SYNC_ENABLED=true to enable WordPress sync
```
**Note:** During `composer create-project`, WordPress core will be downloaded to `vendor/wordpress/`, but files will **not** be synced to your `public/` directory until you set `WP_BOOT_SYNC_ENABLED=true` in your `.env` file.
This gives you time to:
1. Review and configure your `.env` file
2. Verify the target `public/` directory exists and is correct
3. Decide when to sync WordPress files
Once configured, run:
```bash
composer install # or composer update
```
This will trigger the sync script and copy WordPress core files to `../../public/`.
Then add the bootstrap block to your `wp-config.php` file (see "How It Works" section above).
### Directory Structure
After installation, your project structure will look like this:
```
your-project/
├── private/
│ └── wp-boot/
│ ├── vendor/
│ │ └── wordpress/ # WordPress core managed by Composer
│ ├── .env # Environment configuration
│ ├── bootstrap.php
│ ├── composer.json
│ └── post-cmd.sh # rsync sync script
└── public/ # Your WordPress public directory
├── wp-admin/ # Synced from vendor/wordpress
├── wp-includes/ # Synced from vendor/wordpress
├── wp-content/
│ ├── plugins/ # Managed by Composer
│ ├── themes/ # Managed by Composer
│ └── uploads/ # User uploads (not managed)
├── wp-config.php # Modified to include bootstrap
└── index.php # Synced from vendor/wordpress
```
The `post-cmd.sh` script automatically syncs WordPress core files from `private/wp-boot/vendor/wordpress/` to `public/` after every `composer install` or `composer update`.
## Optional: Installing Language Packs
WP Boot includes [WP Translation Downloader](https://github.com/inpsyde/wp-translation-downloader), a Composer plugin that automatically downloads translations from the WordPress.org API for all installed WordPress packages (core, plugins, and themes).
**1. Add your desired languages to `composer.json`:**
In the `extra.wp-translation-downloader.languages` array, add the locale codes you need:
```json
{
"extra": {
"wp-translation-downloader": {
"languages": [
"it_IT"
]
}
}
}
```
Then run `composer update` — translations will be automatically downloaded to `public/wp-content/languages/`.
**2. Configure WordPress to use the language in `.env`:**
```env
WPLANG=it_IT
```
For more information: https://github.com/inpsyde/wp-translation-downloader
## Optional: Disallow Search Engine Indexing in Non-Production
WordPress 5.5+ includes native environment detection via `WP_ENVIRONMENT_TYPE`. Wp-boot automatically sets this based on your `WP_ENV` value in `.env`.
To prevent search engines from indexing staging/development sites, create this file:
**`public/wp-content/mu-plugins/disallow-indexing.php`**
```php
](https://buymeacoff.ee/frugan)
## License
(ɔ) Copyleft 2026 [Frugan](https://frugan.it).
[GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/), see [LICENSE](LICENSE) file.