Keeping Site Editor Changes in Version Control
WordPress Site Editor changes are often saved in the database rather than in theme files, so they may not be included in the version control workflow used for the rest of a site.
For teams managing themes in Git, this can make it harder to track design changes and carry them safely between environments.
Keeping Site Editor changes in version control helps make those changes easier to review, preserve, and deploy.
Understanding how they fit into a release workflow is essential to avoiding surprises when a site moves from staging to production.
Which Site Editor Changes Should You Save?
Save Site Editor changes that affect how your site looks or works, such as templates, template parts, and global styles. These choices shape pages across your site, so keep a record of them when you want to review or restore your design.
Save template edits when you change layouts, such as a page template’s header, content area, or footer. Include template parts you customize, like a shared navigation bar or footer.
If you edit a pattern, save it only when the change affects a reusable design you need to track.
Record style revisions to colors, typography, spacing, and other global settings. These changes can affect many pages at once, so note what you changed and why.
Skip temporary experiments you don’t plan to keep. Focus on deliberate changes that matter to your site’s appearance or behavior.
Export Site Editor Changes to Theme Files
Export your Site Editor changes to theme files so you can track them alongside your code.
This captures edits such as templates and styles, though the exact files depend on your theme.
Then commit the files to version control to keep a clear history.
Export Theme Files
When you’re ready to track Site Editor changes in version control, export them as theme files first. This gives you files you can review, back up, and share with your team.
Export your changes
- Open the Site Editor and select the design or template you want to save.
- Use the editor’s export option to download the changes. Depending on your setup, you may export templates, template parts, or styles.
- Check the downloaded files before adding them to your theme. Template exports usually include HTML files, while global style settings may appear in
theme.json. - Place each file in the matching folder in your theme, such as
templatesorparts. Keep existing files intact unless you mean to replace them.
Export only the changes you want to preserve. If you’re unsure which file controls an element, export a small set first and inspect the results.
Capture Editor Changes
To capture Site Editor changes in your theme, export the templates, template parts, or styles you want to keep, then place the files in the matching theme folders.
In the Site Editor, open the item you changed and use the options menu to download or export it. WordPress may offer a theme export that includes several edited files, or let you save one item at a time. Check the downloaded files before adding them to your theme.
Templates belong in the templates folder, template parts in parts, and style variations in styles. Keep filenames and folder paths intact so WordPress can find each file.
Compare the exported version with your theme’s existing files, then replace only the files you intend to update. This gives each editor change a clear place in your theme and supports revision tracking later. Don’t include unrelated edits.
Commit Version History
After you’ve added the exported files to your theme, commit them to version control so you can track the changes. Include only the files you meant to export, such as theme templates, template parts, and styles. Review the diff before you commit, so you can confirm that it contains your Site Editor updates and no unrelated edits.
Commit your changes
- Check the files with your version control tool, then stage the intended changes.
- Write a clear message, such as “Update header and homepage templates.”
- Commit the files, then confirm the commit appears in your project’s Version History.
Good Commit Tracking makes it easier to find when a design change happened and what it changed. If you exported several updates, commit related files together, or split them into separate commits when you need to review or undo each change independently. Push your commit to the shared repository so your team can access it.
Add Exported Theme Files to Git
Once you’ve exported your Site Editor changes, add the exported theme files to your Git repository so you can review and track them alongside your code.
Add the files
- Place each export in the matching location within your theme file structure, such as
templatesorparts. - Check Git ignore rules to confirm they don’t exclude files you need to track.
- Stage the intended files, then review the staged list before committing.
| File type | Example location | Track it? |
|---|---|---|
| Templates | templates/ |
Yes |
| Template parts | parts/ |
Yes |
Use git status to see which files Git detects. Stage specific paths when possible, rather than adding every change blindly. If an export replaces an existing file, inspect the diff to confirm it contains the updates you expect. Keep unrelated local files out of the commit, so your repository records only the Site Editor changes you chose to preserve.
Test Changes Before You Deploy
Before you deploy, preview your Site Editor changes in a staging site or local copy.
Check key pages and screen sizes, then fix any layout or content issues you find.
Once everything looks right, commit the tested changes to Git.
Preview Changes Safely
Test Site Editor changes on a staging site before you deploy them, so you can check how they look and work without affecting visitors. Your Staging environment should use the same theme, plugins, and sample content as your live site. Open key pages on desktop and mobile, then compare them with the current version. A Visual diff can help you spot layout changes quickly.
| Check | What to review |
|---|---|
| Header | Logo, menu, spacing |
| Templates | Page layout, content |
| Mobile view | Text, buttons, wrapping |
Keep staging private or restrict access, especially if it contains copied customer data. When the preview looks right, record the changes you approved and prepare them for deployment. Don’t treat staging as a perfect copy if its settings or content differ from production; note those differences before you compare results.
Catch Issues Before Deployment
A staging preview shows how Site Editor changes look, but a few focused checks can catch problems before deployment.
Start by reviewing the changed theme files, including templates, template parts, and theme.json. Confirm that the saved markup and settings match what you intended, and check that existing pages still display correctly.
Run focused checks
- Use Automated theme validation to spot invalid block markup, missing files, or theme.json errors. Fix each reported issue, then run the checks again.
- Add Pull request checks so validation runs whenever you submit changes. Review the results before merging, and don’t treat a passing check as a substitute for a visual review.
- Test key page types in staging, such as the homepage, a post, and an archive. Check desktop and mobile layouts, links, and menus.
Deploy only after checks pass and the preview looks right.
Deploy Without Overwriting Site Editor Changes
When you deploy theme files, templates and styles saved in the database can continue to override the updated files. Compare both sources on staging before release; deploying files alone does not remove saved editor customizations.
Prepare the deployment
- Test the release on a staging site that matches production. Check key pages, templates, and global styles in the Site Editor.
- If the staging deployment includes updated theme files, check whether database customizations override them. Preserve or reset those customizations only after reviewing the intended changes and taking a backup.
- Back up the database and files before deploying, and agree on a change freeze so nobody edits the Site Editor during the release.
- Deploy only the files you need. Afterward, open the Site Editor and verify important changes on the live site.
Document which edits belong in files and which belong in the database. This supports change preservation and helps you avoid accidental overwrites.
Restore an Earlier Version From Git
If a deployment overwrote theme files, use Git to restore an earlier version, but first check whether the Site Editor’s database changes also need restoring.
Restore theme files
- Check your working tree with
git status, then identify the commit that contains the files you need. Usegit log --onelineto review recent commits. - Restore specific files with
git restore --source= --- path/to/file. Replace the placeholders with the commit ID and file path. This avoids changing unrelated files. - Review the result with
git diff, run your tests, then commit the restored files and deploy them.
For a broader Version rollback, create a new commit that reverses the unwanted change with git revert . This keeps later history intact. Avoid resetting shared history unless your team agrees.
For commit recovery, check whether the needed work exists in another branch or in git reflog. Git can restore tracked files, but it won’t undo database changes made by the Site Editor. Restore those separately from a database backup if needed.
Frequently Asked Questions
Can Multiple Team Members Edit the Site Editor Simultaneously?
WordPress does not provide built-in real-time collaborative editing in the Site Editor. Coordinate changes with teammates and avoid editing the same shared template at the same time; a separate collaboration tool may offer additional features.
How Can You Resolve Conflicts Between Database and Theme Changes?
Resolve conflicts by choosing one source of truth, then reconcile differences before deploying. With a Database first workflow, export approved editor changes, compare them with theme files, and use theme synchronization to prevent overwrites and preserve intentional updates.
Do Site Editor Exports Include Media Library Files?
Like a packed suitcase, a site editor export typically carries your settings, not Media Library Assets. Check Export File Contents; you’ll usually need to transfer uploaded images separately or preserve them through backups or migration tools.
Which WordPress Roles Can Export Site Editor Changes?
Administrators can export Site Editor changes; Editor access usually doesn’t include that capability. You’ll need Administrator permissions to use WordPress’s built-in export tools, though plugins, custom roles, or multisite settings may alter access on your site.
How Often Should You Commit Site Editor Changes to Git?
Commit site editor changes after each meaningful update; don’t wait for a daily batch. Set a team commit cadence, and maintain a pre release snapshot so you can restore stable designs quickly.
- Site Editor
- version control
- WordPress
About the author
Vladimir Mrkela
Senior WordPress Developer
I’m a senior WordPress developer and co-founder of Pixel Industry. I’ve spent more than 12 years building websites, custom plugins, and integrations for all kinds of projects. I enjoy working on complex architecture, solving tricky problems, and sharing what I learn along the way.