WordPress FAQ

How to Version Control WordPress with Git

The community consensus is to use Git exclusively for custom themes and plugins while managing database synchronization separately via external tools. medium confidence based on 6 community reports

The community consensus is to use Git exclusively for custom themes and plugins while managing database synchronization separately via external tools.

Based on 6 community reports.

Linked sources: 6.

Known Issues

Community Q&A

Should I put my entire WordPress installation in Git?

No, it is considered best practice to only track your custom themes and plugins in Git to avoid repository bloat and maintenance issues.

How do I handle database changes with Git?

Git does not track database changes. You should use tools like WP-CLI or WP Migrate DB to sync database dumps between your local and production environments.

What is the cleanest way to deploy WordPress themes?

Treat the theme repository as the source of truth, use GitHub Actions for CI/CD, and deploy only the compiled output files to your server.

Reddit Sources