.gitignore for WordPress

17 ignore rules for WordPress, ready to copy into your repository.

Content management system

The complete .gitignore for WordPress

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:27:15 UTC
# Technologies: WordPress

### WordPress ###
# Log file
*.log
/wp-admin/
/wp-content/index.php
/wp-content/languages
/wp-content/plugins/index.php
/wp-content/themes/index.php
/wp-includes/
/readme.html
/wp-*.php
/xmlrpc.php
wp-config.php
/wp-content/themes/twenty*/
/wp-content/plugins/hello.php
/wp-content/uploads/
/.htaccess
/index.php
/LICENSE.txt

What these WordPress rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Log files

Pattern What it ignores
*.log Log file
/.htaccess htaccess

General

Pattern What it ignores
/wp-admin/ Core Note: if you want to stage/commit WP core files you can delete this whole section/until Configuration.
/wp-content/index.php General
/wp-content/languages General
/wp-content/plugins/index.php General
/wp-content/themes/index.php General
/wp-includes/ General
/readme.html General
/wp-*.php General
/xmlrpc.php General
/index.php General
/LICENSE.txt General

Configuration

Pattern What it ignores
wp-config.php Configuration

Example themes

Pattern What it ignores
/wp-content/themes/twenty*/ Example themes

Example plugin

Pattern What it ignores
/wp-content/plugins/hello.php Example plugin

Uploads

Pattern What it ignores
/wp-content/uploads/ Uploads

How to use this .gitignore for WordPress

  1. Copy the WordPress rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other CMS .gitignore templates

See every CMS template