PHPackages                             gaambo/deployer-wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. gaambo/deployer-wordpress

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

gaambo/deployer-wordpress
=========================

Deployer tasks for deploying WordPress Sites

v4.0.1(2mo ago)487686[4 issues](https://github.com/gaambo/deployer-wordpress/issues)[1 PRs](https://github.com/gaambo/deployer-wordpress/pulls)MITPHPPHP ^8.1CI passing

Since Jun 3Pushed 2w ago1 watchersCompare

[ Source](https://github.com/gaambo/deployer-wordpress)[ Packagist](https://packagist.org/packages/gaambo/deployer-wordpress)[ Docs](https://github.com/gaambo/deployer-wordpress)[ RSS](/packages/gaambo-deployer-wordpress/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (7)Versions (20)Used By (0)

Deployer WordPress Recipes
==========================

[](#deployer-wordpress-recipes)

[Deployer](https://deployer.org) tasks and recipes for deploying WordPress sites. Supports simple rsync deployments, custom theme/plugin builds, and complex setups including Bedrock and multisite.

Table Of Contents
-----------------

[](#table-of-contents)

- [Deployer WordPress Recipes](#deployer-wordpress-recipes)
    - [Table Of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Requirements](#requirements)
    - [Configuration](#configuration)
        - [Default Directory Structure](#default-directory-structure)
        - [Localhost context](#localhost-context)
        - [wp-config.php](#wp-configphp)
        - [Rsync filters/excludes/includes](#rsync-filtersexcludesincludes)
    - [Tasks](#tasks)
        - [Database Tasks (`tasks/database.php`)](#database-tasks-tasksdatabasephp)
            - [Multisite support](#multisite-support)
        - [Packages system (`tasks/packages.php`)](#packages-system-taskspackagesphp)
        - [File Tasks (`tasks/files.php`)](#file-tasks-tasksfilesphp)
        - [WordPress Tasks (`tasks/wp.php`)](#wordpress-tasks-taskswpphp)
        - [Language Tasks (`tasks/languages.php`)](#language-tasks-taskslanguagesphp)
        - [Uploads Tasks (`tasks/uploads.php`)](#uploads-tasks-tasksuploadsphp)
        - [Legacy Tasks (Themes, Plugins, MU-Plugins)](#legacy-tasks-themes-plugins-mu-plugins)
        - [WP-CLI](#wp-cli)
        - [Recipes](#recipes)
            - [Simple](#simple)
            - [Bedrock](#bedrock)
    - [Changelog](#changelog)
    - [Contributing](#contributing)
        - [Testing](#testing)
    - [Built by](#built-by)

Installation
------------

[](#installation)

1. `composer require gaambo/deployer-wordpress --dev`
2. Copy example files from `examples/simple/` or `examples/bedrock/` to your project root
3. Customize `deploy.php` and `deploy.yml`:

- Set `current_path` for all hosts (remote + localhost)
- Configure custom code as [packages](#packages-system-taskspackagesphp)
- Adjust deployment flow if needed

4. Test on staging first, then deploy to production 🚀

Requirements
------------

[](#requirements)

- PHP + [Composer](https://getcomposer.org)
- [Deployer](https://deployer.org) (automatically installed)
- WordPress installation
- \*nix OS (Linux/macOS or [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) on Windows)
- `rsync` installed

Optional (auto-installed on remote if missing):

- [WP-CLI](https://wp-cli.org/) for database tasks
- [Composer](https://getcomposer.org) for package vendors (depending on your custom theme/plugins)
- [Node.js/npm](https://nodejs.org/) for building assets (depending on your custom theme/plugins)

Configuration
-------------

[](#configuration)

Example recipes (in `examples/`) provide configuration starting points. The library works with any WordPress setup ( vanilla, Composer, subdirectory, Bedrock, multisite) by making all paths and directories configurable. Check the example recipes and task source files for available options.

### Localhost context

[](#localhost-context)

Version 4 introduces a proper `Localhost` context. This ensures that when tasks run on your local machine (like building assets or backing up the local database), they use configuration values specifically defined for localhost, rather than falling back to global or remote values.

Configure localhost in `deploy.php`:

```
localhost()
    ->set('public_url', 'http://wp-boilerplate.test')
    ->set('current_path', 'public') // WordPress root
    ->set('dbdump_path', __DIR__ . '/data/db_dumps')
    ->set('backup_path', __DIR__ . '/data/backups');
```

The `Localhost` utility class (`Gaambo\DeployerWordpress\Localhost`) handles switching context automatically in tasks.

### wp-config.php (Recommendation)

[](#wp-configphp-recommendation)

Keep `wp-config.php` in git and deploy it. Extract environment-specific config (database credentials, `WP_DEBUG`) into `wp-config-local.php`, which should be gitignored and created manually on each host. Require it from `wp-config.php`:

```
if (file_exists(__DIR__ . '/wp-config-local.php')) {
    require_once __DIR__ . '/wp-config-local.php';
}
```

### Rsync filters

[](#rsync-filters)

The default rsync config uses `.deployfilter` files for per-directory filtering. Place a `.deployfilter` file in your theme/plugin to exclude development files:

```
- phpcs.xml
- README.md
- .babelrc
- node_modules
- .eslintignore
- .eslintrc.json
- .stylelintignore
- .stylelintrc.json
- gulp.config.js
- gulpfile.babel.js
- package.json
- package-lock.json
- .babelrc
- phpcs.xml

```

This prevents any development files/development tools from syncing. I strongly recommend you put something like this in your custom theme and mu-plugins or overwrite any of the `themes/filter` or `mu-plugins/filter` configurations.

Tasks
-----

[](#tasks)

Tasks are in the `tasks/` directory. Run `dep list` to see all available tasks. See task source files for configuration options.

### Database Tasks (`tasks/database.php`)

[](#database-tasks-tasksdatabasephp)

- `db:remote:backup`: Backup remote database and download to localhost
- `db:local:backup`: Backup local database and upload to remote host
- `db:remote:import`: Import current database backup (from localhost) on remote host
- `db:local:import`: Import current database backup (from remote host) on local host
- `db:push`: Pushes local database to remote host (combines `db:local:backup` and `db:remote:import`)
- `db:pull`: Pulls remote database to localhost (combines `db:remote:backup` and `db:local:import`)

#### Multisite support

[](#multisite-support)

For multisite installations, set `wp/multisite` to `true` to enable network-wide search-replace during database sync:

```
set('wp/multisite', true);
```

### Packages system (`tasks/packages.php`)

[](#packages-system-taskspackagesphp)

Manage custom themes, plugins, and mu-plugins with individual build configs:

```
set('packages', [
    'custom-theme' => [
        'path' => '{{themes/dir}}/custom-theme',
        'remote:path' => '{{themes/dir}}/custom-theme', // optional
        'assets' => true,
        'assets:build_script' => 'build',
        'vendors' => true,              // Run composer install
    ],
    // Add more packages as needed
]);
```

**Tasks:**

- `packages:assets:vendors` - Install npm dependencies
- `packages:assets:build` - Run build scripts
- `packages:vendors` - Install composer dependencies
- `packages:push` / `packages:pull` - Sync packages

### Other Task Categories

[](#other-task-categories)

**File Tasks** (`tasks/files.php`)

- `files:push` / `files:pull` - Sync all files (combines wp, uploads, plugins, themes, packages)

**WordPress Core** (`tasks/wp.php`)

- `wp:download-core`, `wp:push`, `wp:pull`, `wp:info`

**Languages** (`tasks/languages.php`)

- `languages:push`, `languages:pull`, `languages:sync`, `languages:backup:*`

**Uploads** (`tasks/uploads.php`)

- `uploads:push`, `uploads:pull`, `uploads:sync`, `uploads:backup:*`

**Legacy Tasks** (use [packages](#packages-system-taskspackagesphp) instead)

- Themes: `themes:push`, `themes:pull`
- Plugins: `plugins:push`, `plugins:pull`
- MU-Plugins: `mu-plugins:push`, `mu-plugins:pull`

Recipes
-------

[](#recipes)

v4 uses `current_path` for rsync-based deployments. Symlinked releases are still possible but not the default.

**`recipes/simple.php`** - Standard WordPress. Rsyncs directly to `current_path`. Recommended for most projects.

**`recipes/bedrock.php`** - [Roots Bedrock](https://roots.io/bedrock/) projects with appropriate structure and environment handling.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

Contributing
------------

[](#contributing)

Issues, feature requests, and pull requests welcome at [GitHub](https://github.com/gaambo/deployer-wordpress). Code follows PSR-2 and Deployer best practices.

### Testing

[](#testing)

The library includes a comprehensive test suite with unit, integration, and functional tests.

- Run `composer precommit` before submitting a PR — it runs lint, code style, PHPStan, and all tests.
- Functional tests use a mocked environment to verify rsync commands and file operations without real remote connections.

The library supports both Deployer v7 and v8. Test against both before submitting (note: Deployer v7 requires PHP 8.2 or 8.3 — it is incompatible with PHP 8.4+):

```
# Switch to Deployer v7
composer require --no-update deployer/deployer:"7.5.*"
composer update deployer/deployer --with-dependencies
composer precommit

# Switch back to v8
composer require --no-update deployer/deployer:"^7.3 || ^8.0"
composer update deployer/deployer --with-dependencies
composer precommit
```

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance91

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 94.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~180 days

Recently: every ~264 days

Total

15

Last Release

67d ago

Major Versions

1.4.1 → 2.0.02023-03-20

2.0.0 → 3.0.0-alpha2023-05-23

3.1.0 → v4.x-dev2026-03-20

PHP version history (3 changes)1.0.1PHP ^7.0

2.0.0PHP ^8.0|^7.3

v4.x-devPHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/132369400?v=4)[FT](/maintainers/fabiantodt)[@fabiantodt](https://github.com/fabiantodt)

---

Top Contributors

[![gaambo](https://avatars.githubusercontent.com/u/5585580?v=4)](https://github.com/gaambo "gaambo (81 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![rslanzi](https://avatars.githubusercontent.com/u/7341598?v=4)](https://github.com/rslanzi "rslanzi (2 commits)")[![quintenbuis](https://avatars.githubusercontent.com/u/36452184?v=4)](https://github.com/quintenbuis "quintenbuis (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gaambo-deployer-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/gaambo-deployer-wordpress/health.svg)](https://phpackages.com/packages/gaambo-deployer-wordpress)
```

###  Alternatives

[lorisleiva/laravel-deployer

Laravel Deployer is a lightweight wrapper of Deployer giving Artisan the power of zero-downtime deployment.

1.7k1.3M4](/packages/lorisleiva-laravel-deployer)[sourcebroker/deployer-extended

Library with some additional tasks for deployer (deployer.org).

25292.2k12](/packages/sourcebroker-deployer-extended)[hypernode/deploy-configuration

Hypernode deploy configuration files

12133.0k](/packages/hypernode-deploy-configuration)[ngmy/webloyer

Webloyer is a Web UI for managing Deployer deployments

2191.1k](/packages/ngmy-webloyer)[n98/n98-deployer

netz98 deployer tasks, recipes, configuration

2544.7k1](/packages/n98-n98-deployer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
