.gitignore and composer.json generator for WordPress
Composer-managed WP repo, ready in one shot.
Genuinely free. No sign-up, no email, no limits, no cookies. We don't store the URL you analyse.
Code
# .gitignore
/wp-content/uploads/
/wp-content/cache/
/wp-content/upgrade/
.env
wp-config.php
/vendor/
/node_modules/
# composer.json
{
"name": "example/my-wp-project",
"type": "project",
"require": {
"php": ">=8.2",
"johnpbloch/wordpress": "^6.9",
"composer/installers": "^2.0"
},
"repositories": [
{ "type": "composer", "url": "https://wpackagist.org" }
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
"wp-content/themes/{$name}/": ["type:wordpress-theme"]
}
},
"config": {
"allow-plugins": {
"composer/installers": true,
"johnpbloch/wordpress-core-installer": true
}
}
}
# Add plugins/themes with:
# composer require wpackagist-plugin/<slug>
# composer require wpackagist-theme/<slug>What it's for
Versioning an entire WordPress site with git, uploads included, is almost always a mistake: huge repositories and pointless conflicts. With Composer you version only the code, not the content users upload, and core/plugins stay installable with one command. Here you get both starting files.
Frequently asked questions
›Do I need to install paid premium plugins this way?
Only free WordPress.org plugins are on wpackagist by default. Premium plugins need the vendor's private Composer repository (many provide one) or should be kept out of Composer, in their own separately-ignored folder.