Starter project for WordPress
Upon a standard WordPress installation, you have a setup that only has the most basic settings configured. There is a lot of settings you can tweak to improve security, performance and/or usability.
Here you can find an example project setup for common use cases.
The configuration can be used to install and update a WordPress site using Composer. The setup already includes some useful plugins. Change composer.json to fit your needs. Available plugins for Composer can be found on WordPress Packagist. All stable releases from wordpress.org should be available.
To install WordPress, run:
To install WordPress without development plugins, run:
composer install --no-dev
You can also install WordPress without
composer create-project wee/wordpress-project
This will install and start to configure WordPress. It will ask for your database credentials and information for your site. After the install you should have a .env file that contains your database and WordPress settings.
To log into WordPress go to http://localhost/wp/wp-login.php
After Composer has finished, WordPress will be available in the 'web' folder. You can change the path in the composer.json. After the install you can remove the 'src/web' folder.
If you do not plan to update WordPress with Composer, you can remove the composer.json and composer.lock files and 'src' folder after the install.
See composer-full.json for a large selection of packages that could be useful.
If you intend to update WordPress with Composer only, add the following lines to the .env file. This will disable auto-updates and updates from the WordPress admin.
WP_AUTO_UPDATE_CORE=0 WP_AUTOMATIC_UPDATER_DISABLED=1 WP_DISALLOW_FILE_MODS=1
See .env-reference for available settings / examples.
To update WordPress, including plugins and themes, run:
Or without development plugins:
composer update --no-dev
You can also use WP-CLI to update WordPress:
vendor/bin/wp core update vendor/bin/wp core update-db vendor/bin/wp language core update vendor/bin/wp plugin update --all vendor/bin/wp language plugin update --all vendor/bin/wp theme update --all vendor/bin/wp language theme update --all