Skip to content

Instantly share code, notes, and snippets.

@joemaller
Last active August 11, 2023 21:40
Show Gist options
  • Save joemaller/4f7518e0d04a82a3ca16 to your computer and use it in GitHub Desktop.
Save joemaller/4f7518e0d04a82a3ca16 to your computer and use it in GitHub Desktop.
A comprehensive .gitignore file for managed WordPress hosts.
# Managed WordPress Hosting .gitignore file for ignoring WordPress files
#
# Most recent revision here:
# https://gist.github.com/joemaller/4f7518e0d04a82a3ca16
#
# Raw Source (for curl):
# https://gist.githubusercontent.com/joemaller/4f7518e0d04a82a3ca16/raw
#
# Used by these WordPress Development environments:
# https://github.com/ideasonpurpose/docker-wordpress-dev
# https://github.com/ideasonpurpose/basic-wordpress-vagrant (deprecated)
#
# Originally based on WP Engine's gitignore files:
# https://wpengine.com/support/using-git-on-sites-with-legacy-staging/#ignore
# https://wpengine.com/wp-content/uploads/2013/10/recommended-gitignore-no-wp.txt
# environment vars
.env
# temp files, OS junk and dotfiles
*.bak
*.swp
*.tmp
*~
.cvs
.DS_Store
.listing
.svn
Thumbs.db
# wp core (as of 4.6)
/db-config.php
/index.php
/license.txt
/readme.html
/wp-activate.php
/wp-admin
/wp-app.php
/wp-atom.php
/wp-blog-header.php
/wp-comments-post.php
/wp-commentsrss2.php
/wp-config-sample.php
/wp-content/index.php
/wp-content/themes/index.php
/wp-content/themes/twenty*
/wp-cron.php
/wp-feed.php
/wp-includes
/wp-links-opml.php
/wp-load.php
/wp-login.php
/wp-mail.php
/wp-pass.php
/wp-rdf.php
/wp-register.php
/wp-rss.php
/wp-rss2.php
/wp-settings.php
/wp-signup.php
/wp-trackback.php
/xmlrpc.php
# wordpress config, user-content and caches
cache/
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir
wp-content/cache/
wp-content/cache/supercache/
wp-content/managewp/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
# WordPress debugging files & logs
*.log
debug.log
log.txt
logs/
# Third-party files and leftovers
gt-cache/
ics-importer-cache/
imagecache.*
pclzip-*.gz
wp-content/w3-.*
wp-content/w3tc.*
gallery/*
album/*
# wpengine specific
.smushit-status
_wpeprivate
wp-content/advanced-cache.php
wp-content/object-cache.php
# flywheel specific
wp-content/flywheel-config/
# large/disallowed file types
# a CDN should be used for these
*.3gp
*.3gpp
*.asf
*.asx
*.avi
*.bin
*.deb
*.dll
*.dmg
*.exe
*.flv
*.hqx
*.img
*.iso
*.kar
*.m4a
*.m4v
*.mid
*.midi
*.mng
*.mov
*.mp3
*.mp4
*.mpeg
*.mpg
*.msi
*.msm
*.msp
*.ogg
*.ra
*.webm
*.wmv
# don't commit database dumpfiles
*.sql
*.sql.gz
*.sql.tgz
*.sql.zip
# npm and composer dependencies
node_modules/
vendor/
# Let's try ignoring sourcemaps
*.css.map
*.js.map
# basic-wordpress-vagrant v0.3.0 added links to Kint and XHProf. Ignore them
/kint
/xhprof
# Moving away from Git-deploys, exclude generated artifacts
/_builds/
/builds
dist/
# Webpack Stats & profiler
/webpack
# Ignore all plugins
wp-content/plugins
wp-content/mu-plugins
# I have not yet wanted these files in project history
*.code-workspace
# Docker experiments
_log/
_profiler/
# WSL 2 Cruft
*:Zone.Identifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment