An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

![PHP Version](https://img.shields.io/packagist/php-v/wp-spaghetti/wp-boot)
![Packagist Downloads](https://img.shields.io/packagist/dt/wp-spaghetti/wp-boot)
![Packagist Stars](https://img.shields.io/packagist/stars/wp-spaghetti/wp-boot)
![GitHub Actions Workflow Status](https://github.com/wp-spaghetti/wp-boot/actions/workflows/release.yml/badge.svg)
![Coverage Status](https://img.shields.io/codecov/c/github/wp-spaghetti/wp-boot)
![Known Vulnerabilities](https://snyk.io/test/github/wp-spaghetti/wp-boot/badge.svg)
![GitHub Issues](https://img.shields.io/github/issues/wp-spaghetti/wp-boot)

![GitHub Release](https://img.shields.io/github/v/release/wp-spaghetti/wp-boot)
![License](https://img.shields.io/github/license/wp-spaghetti/wp-boot)

# 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.