
After learning the basics of Git, WordPress developers often struggle to find a reliable way to deploy their WordPress sites and themes automatically in a way that complements their workflow. Learn more about DeployHQ for developers.
This guide was originally published in 2022 and refreshed for 2026. The core workflow still applies, now with up-to-date features like automatic deployments, Build Pipelines, and Turbo Deployments.
In this post, we're going to take a look at:
- Why you should automate your WordPress deployment workflow
- A couple of the most popular solutions out there
- Setting up a simple way to deploy changes to a WordPress theme whenever you
git pushusing DeployHQ
Why automate deployments in the first place?
Save time
With an automated deployment solution, you won't need to manually keep copying files over to your server when they've changed.
Deploy more often
If you're regularly making small tweaks to your theme, you can just git push after a change has been committed, and everything else will be taken care of automatically, meaning you can spend more time focusing on improving the theme and less worrying about how to make the changes live on your server.
Reduce mistakes
A dedicated deployment solution should only upload the files that changed since your last deployment, so you won't run into a problem where you might have forgotten to upload one of your changed files when doing so by hand.
Multiple locations
Deployment solutions allow you to deploy from anywhere, at any time. With automation in place, any developer with access to the repository can deploy. Learn more about DeployHQ for developers.
Easier for teams
You should even be able to allow different levels of access to different users, depending on where and when you want them to deploy. You could set up users who can only deploy to certain environments, such as testing and staging, but not production. Some solutions even allow you to stop deployments going out at 5pm on a Friday. Learn more about DeployHQ deployment targets.
And then what about:
- Quickly resolving a bug, how do you know which files to change or roll back?
- What if you're deploying to more than one server at the same time - how do you make a consistent process that works across all servers?
- The period of downtime if someone visits the site in the middle of uploading some changes?
- What if you simply don't have immediate access to connect to the server?
These are just some of the problems you'll almost certainly run into when using a manual
method of updating the website. However, there are a number of solutions for automatically deploying your changes, which we'll outline below, each with their own advantages and disadvantages.
Comparing WordPress Deployment Methods
Before diving into the setup, let's compare the most common approaches to deploying WordPress themes:
| Method | Pros | Cons | Best For |
|---|---|---|---|
| Manual FTP/SFTP | Simple, no setup required | Error-prone, time-consuming, no version tracking | Quick one-off changes |
| Git Pull on Server | Version controlled, only changed files | Requires SSH access, manual login needed | Developers comfortable with CLI |
| Command-line Tools (Capistrano) | Powerful, scriptable, supports migrations | Steep learning curve, local setup required | Advanced developers, complex deployments |
| Web-based Tools (DeployHQ) | User-friendly, team features, automated | Requires account setup | Teams, frequent deployments, multiple environments |
Manually uploading changes
We've already touched on this one earlier in the post. It is possibly the simplest option out of the box: connect to the website server via a local client or web hosting control panel, then upload or remove any files that need to change.
Pull down changes using Git directly on the server
A common method is to install Git on the web server too, then when you're happy with your changes, log in to the server and run git pull. Alternatively, you can add the server as an additional remote and run git push to it.
This will ensure only changed files will be deployed and rolling back to an older version in the event of an issue is just a case of running a git revert, then pushing /pulling that rollback to the server.
Command-line tools
A number of dedicated command-line deployment tools exist, allowing developers to deploy their website from the terminal. A long-standing example is Capistrano, which uses your local copy of the website (via Git) and can run commands such as database migrations across multiple environments. This results in something as simple as cap deploy production to start a deployment.
Web-based deployment tools
Last but by no means least, there are several deployment tools specifically designed for this part of your workflow. Standard features like rollbacks, automatic deployments, environment management (staging and production, for example), and deploy-time commands are immediate advantages. Newer options like Turbo Deployments can also speed up transfer-heavy projects.
This holds all the same advantages as a command-line based tool, but with additional features such as user access control and time-based restrictions, you can ensure only the correct users can deploy, and when.
Deploying your WordPress theme with DeployHQ
DeployHQ is a service that allows you to set up all the necessary steps to make deploying your website simpler, faster and more reliable. There is even a free plan to allow you to deploy a single project. If you're a developer managing multiple WordPress sites, DeployHQ makes it easy to standardise your deployment workflow.
The following diagram shows how DeployHQ fits into your WordPress development workflow:
flowchart LR
A[Local Development] -->|git push| B[Git Repository]
B -->|Webhook triggers| C[DeployHQ]
C -->|Build Commands| D[Compile Assets]
D -->|Deploy| E[WordPress Server]
E -->|wp-content/themes/| F[Your Theme]
style C fill:#4a90d9,stroke:#333,color:#fff
style F fill:#21759b,stroke:#333,color:#fff
When deploying your WordPress theme through DeployHQ, you'll firstly need to ensure the theme file has been committed to a repository host, and your server is set up with WordPress installed. To create your project within DeployHQ, you'll first be prompted to connect your repository, then asked to enter your server connection details.
You will be able to find the necessary server connection details and credentials within your hosting account. You can also find a series of guides for a number of the most popular hosting providers on our website:
If the user you're connecting as has access to the full WordPress install, you'll need to enter a deployment path of /wp-content/themes/theme-name
to ensure the files from the repository are transferred to the theme's folder within the WordPress install. For more details on configuring deployment targets, see our features documentation.
During your first deployment, all files within your repository will be transferred. If these files already exist on your server, you can skip the initial deployment and choose to just deploy the changes going forwards:
Skip deploying from scratch on your first deployment
Enabling Automatic Deployments
You can choose to have deployments triggered automatically whenever you push to your repository. For supported Git providers, DeployHQ can configure webhooks during setup.
If you connected a repository manually or use a self-hosted provider, add the webhook yourself from your project's Automatic Deployments
section.
From that same page, you can choose which servers should auto-deploy. The branch used for automatic deployments is set per server in its settings.
Using Build Commands
A lot of modern websites involve installing external dependencies or compiling code for purposes such as reducing the size of client-side JavaScript and CSS.
Doing this, then storing the compiled assets alongside the originals in the repository itself can cause a number of problems such as merge conflicts, so with a dedicated tool like DeployHQ's Build Pipeline you can run these commands in real-time during the deployment, and only have the assets that have changed uploaded to your server.
Just head to your project's Build Pipeline area, add any commands you need to run and DeployHQ will do the rest. You can also add build-cache directives to keep dependencies between deployments and avoid downloading everything each time.
Common build commands for WordPress themes include:
# Install npm dependencies
npm install
# Compile Sass/SCSS to CSS
npm run build
# Or if using Composer for PHP dependencies
composer install --no-dev --optimize-autoloader
Using Config Files
Several files will be needed for a website to function, such as a config file that contains access information for a local database. Due to the sensitive nature of these files, it's bad practice to store them in a distributed system such as a Git repository. However, with DeployHQ you can add these files to your project as Config files
, keeping them protected and only in one place.
Simply head to your Config files area in your project, then add the contents directly in the editor and set the destination path on your server. The file will then be uploaded automatically with every deployment.
Frequently Asked Questions
Can I deploy only my theme and not the whole WordPress site?
Yes. Set your deployment path to the theme directory (for example: /wp-content/themes/your-theme) so only theme files are uploaded.
Should I store built assets in Git for WordPress themes?
Usually no. It is cleaner to build during deployment using Build Pipelines and upload the generated assets as part of the release.
What branch should trigger automatic deployments?
Use the branch configured on each server in DeployHQ. A common setup is auto-deploy from main to staging, then promote to production after verification.
Is rollback possible if a deployment introduces a problem?
Yes. DeployHQ supports quick rollback to previous file versions. If your release includes database changes, make sure rollback commands are explicitly planned and tested.
These are just some of the many advantages that a dedicated deployment solution such as DeployHQ can provide. You can find more information about our features on our website, and of course, get in touch with us if you have any questions about how DeployHQ can help make your WordPress theme deployments easier.