PHPackages                             leymannx/wordpress-project - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leymannx/wordpress-project

ActiveProject[Utility &amp; Helpers](/categories/utility)

leymannx/wordpress-project
==========================

Composer template for WordPress projects.

1.3.1(7y ago)033GPL-2.0+PHP

Since Apr 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/leymannx/wordpress-project)[ Packagist](https://packagist.org/packages/leymannx/wordpress-project)[ RSS](/packages/leymannx-wordpress-project/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (11)Used By (0)

Composer Template for WordPress Projects
========================================

[](#composer-template-for-wordpress-projects)

```
composer create-project leymannx/wordpress-project some-dir --stability stable --no-interaction

```

Replace `some-dir` with whatever directory name you wish.

### Usage

[](#usage)

1. Run above command.
2. Point your vhost to `some-dir/web`.
3. Open site in browser and start WordPress installation as usual.

Optionally:

- After successful installation move `some-dir/web/wp-config.php` into `some-dir/wp-config/wp-config.php` and run `composer install` once again.
- Install [`leymannx/wp-cli-launcher`](https://github.com/leymannx/wp-cli-launcher) to let the `wp` command use this project's `some-dir/bin/wp` from any location inside the project.

### Custom plugins and themes

[](#custom-plugins-and-themes)

Custom stuff all goes inside `some-dir/wp-custom`. There are subfolders for themes and plugins. They will get symlinked automatically into the right location on every `composer install` run.

### wordpress.org plugins and themes

[](#wordpressorg-plugins-and-themes)

Plugins are added to your project by running `composer require wpackagist-plugin/plugin-name` and themes by `composer require wpackagist-theme/theme-name`. You then can enable them normally via WP-CLI or from the backend as usual.

```
cd some-dir
composer require wpackagist-plugin/wordpress-seo
```

### Update WordPress, plugins and themes

[](#update-wordpress-plugins-and-themes)

Managing your WordPress site with Composer means you also update it with Composer. And maybe use a plugin like [WP Update Settings](https://wordpress.org/plugins/wp-updates-settings/) to disable backend notifications.

```
composer update --with-dependencies
```

### Recommendations

[](#recommendations)

I strongly recommend to use [WP-CFM](https://wordpress.org/plugins/wp-cfm/) to synchronize your WordPress configuration across all environments. After you activated the plugin you may want to have the config exported to/imported from `some-dir/wp-config/cfm`. So place the following code into a custom mu-plugin under `some-dir/wp-custom/mu-plugins/some-file.php` and run `composer install` once to have it symlinked into the right location.

```
