Tutorial · migration-hosting · Published 2026-08-16 · 4 min read

Moving a WordPress site to repository-based deployments

Move WordPress to Git repository-based deployments with wp-content version control, deploy etiquette and DB/front-end split guidance.

Repository-based deployments mean the content of your site lives in a Git repository and every release is built and pushed from a commit, rather than uploaded by hand. For WordPress it is common to version-control the parts that are under your control (theme, plugins, wp-content) and treat the core and the database separately.

Structure the repo

Define deploy steps

  1. Pull on the target. On the production or staging server, run a deploy command that fetches the latest commit, for example git pull in the web root, or use a deploy tool such as Deployer that checks out a clean tree.
  2. Move the uploads back after a clean checkout. A brand-new clone does not contain media, so link or copy the live uploads folder into the fresh wp-content location, or configure an object-storage integration.
  3. Push plugin and theme changes, then activate in the dashboard. After a release, log in and run any required wp plugin update or theme re-save in a staging environment first so you catch breakage before production.
  4. Use a branch for the next release. Keep main as the deployable branch and develop on a feature branch. Merge to main only after tests pass on staging.
  5. Tag your releases. A tag such as v1.4.2 gives you an exact checkpoint to roll back to, which pairs with a restore drill rather than a manual "undo".

Handle database

Prevention

When to involve a professional

Bring in a hosting or DevOps specialist if you need a fully automated pipeline (GitHub Actions or similar) with database migration and zero-downtime deploys, or if an existing site has a messy root where separating core, plugins and uploads is not straightforward.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services