Staging to Live WordPress Without Losing Changes

Short answer: to move staging to live WordPress without losing changes, do not copy the staging database over the live one. That database is a snapshot from the day you made the copy, so replacing live with it erases every comment, order, form entry, user and post added since. Instead, sort each change by where it lives: files (theme and plugin code) can be copied across; content can be moved selectively with Tools > Export and Tools > Import; settings, menus and Site Editor tweaks are usually safest repeated by hand on live.

Written against WordPress 7.1.2. Last verified: September 27, 2026.

First: understand what a full push destroys

Before any push, you need a backup of the live site, files and database, that you have confirmed you can restore. Our five-minute ritual before any risky WordPress edit covers the minimum, and verifying a WordPress backup before you need it covers the proof.

Here is the risk in plain terms. Your staging copy started as a copy of live on a certain day. From that day on, the two sites drifted apart:

  • Staging gained your deliberate changes: a new design, a new page, a plugin configuration.
  • Live gained real activity: comments, new users, contact form entries, orders if you run a shop, and any posts you or a colleague published.

Many "push to live" buttons, and every manual "export staging database, import into live" job, replace the live database with the staging one. Your deliberate changes arrive. The real activity from the gap disappears, with no warning, because from the database's point of view nothing was deleted: it was simply replaced by an older version.

That is why the answer to "if I push this, do I lose the comments from this week?" is yes, if the push includes the database.

Step 1: write down every change you made on staging

This is the step that makes everything else safe, and the one most people skip. Go through your staging work and list every change. Then mark each one by where it lives:

Kind of change Where WordPress stores it Safest way to move it
Edited theme or child theme files (PHP, CSS, theme.json) Files in wp-content/themes Copy the changed files or that one theme folder
A plugin added or updated Files in wp-content/plugins, plus settings in the database Install or update the same plugin on live, then repeat its settings
A new page or post Database Tools > Export on staging, Tools > Import on live, or recreate it
Edited existing pages Database Recreate the edits on live, or copy the block content across
Site settings (Settings screens) Database Repeat by hand on live
Menus and widgets Database Repeat by hand on live
Site Editor styles and template edits Database Repeat by hand, or use the Site Editor's export (see Step 4)
New images Files in wp-content/uploads, plus a database entry Upload them again through the live Media Library

The WordPress Theme Handbook's page on global settings and styles says customizations made in the Site Editor are "saved in their site's database," which is why they sit in the database rows of this table rather than with the theme files.

If your list contains only file changes, you are in the easy case. If it contains database changes, keep reading before you touch anything.

Step 2: check what has happened on live since the copy

Open the live site's admin and note anything created after the staging copy was made:

  • New comments (the Comments screen, sorted by date).
  • New users (the Users screen).
  • New or edited posts and pages (sort by date in the Posts and Pages lists).
  • New media uploads.
  • Orders, bookings, memberships or form entries, if a plugin on your site handles them.

If this list is empty, and you are sure nobody will add anything during the push, a full replacement is less dangerous. On any site with visitors who comment, buy or sign up, it is rarely empty.

Step 3: push the file changes only

For theme and plugin code, copy files, not databases:

  1. On staging, identify the exact folders you changed, for example wp-content/themes/your-child-theme.
  2. Download that folder from staging.
  3. On live, rename the existing folder first (for example add -old to the end) rather than deleting it, so you can switch back in seconds.
  4. Upload the staging version in its place.
  5. Load the live site and check the pages the change affects.
  6. When you are satisfied, delete the -old copy.

Do not copy the whole wp-content folder. It contains uploads, and live's uploads has images that staging never saw. Copy only the theme or plugin folders from your list.

If a plugin was added on staging, install the same plugin on live through the Plugins screen rather than copying its folder, then repeat its settings. Settings live in the database, so they do not travel with the folder.

Step 4: move database changes selectively

New pages and posts: Tools > Export and Tools > Import

The Tools Export screen documentation on WordPress.org (last updated June 8, 2024, read September 27, 2026) says the export creates an XML file in the WordPress eXtended RSS (WXR) format containing "your posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies, and users," which you can bring into another site through Tools > Import > WordPress.

The useful part for this job is the filters. The same page lists options to export only Pages or only Posts, narrowed by author, date range and status. So:

  1. On staging, go to Tools > Export.
  2. Choose Pages (or Posts) and set a date range that covers only the items you created on staging.
  3. Download the file.
  4. On live, go to Tools > Import, choose WordPress, and import the file. If WordPress asks to install the importer first, that is part of the normal process.
  5. Check each imported page on live. Links inside it may still point at the staging address, and images uploaded only on staging need to be uploaded on live as well, because the documentation's list of what the export contains does not include the image files themselves.

Exporting everything instead of the filtered set is how people end up with duplicate pages and old versions on live. Keep the export narrow.

Settings, menus and widgets: repeat them by hand

There is no core tool that moves individual settings from one site to another. For a handful of changes, repeating them on live from your Step 1 list is faster and far safer than any database transfer. This is where the written list pays off: you are copying from a checklist, not from memory.

Site Editor changes: by hand, or the export with care

For a few style changes (a color, a font size, a spacing value), repeat them in the live Site Editor.

For larger design work, the Site Editor has an Export option. The Make WordPress Core post on theme export in WordPress 6.0 (May 2, 2022, read September 27, 2026) explains that it copies all files from the current theme into a zip and "extracts the template changes that are stored in the database to files," so the zip includes your edits to templates and styles. Two cautions before you install that zip on live:

  • It turns your changes into theme files. If the original theme later receives an update, installing the update can replace those files, which our guide to updating a WordPress theme without losing customization explains.
  • The same post notes that the export may reorder and rewrite parts of theme.json. Treat the exported theme as a new version to test, not a drop-in.

If that sounds like more than you want to manage, the by-hand route is the honest recommendation for a small site.

When you really must replace the whole database

Sometimes the changes are too many to repeat. If you must replace the live database, shrink the gap instead of ignoring it:

  1. Pick a quiet time and tell anyone who edits the site to stop.
  2. Close the doors that create new data: turn off comments temporarily, and pause any shop checkout, registration or form that stores entries.
  3. Refresh staging from live right before the push (copy the current live database into staging), then redo or re-check your changes on that fresh copy.
  4. Take a new backup of live.
  5. Push, check the site, then reopen comments and forms.

The gap between the refresh and the push is now minutes, and nothing can arrive during it because you closed the doors.

After the push: a short check

  • The changed pages look right on live.
  • Comments, users and posts from the last few days are still there. Open the newest comment and newest post to confirm.
  • Images load, including recent uploads.
  • No links on live point at the staging address.

If something went badly wrong, restore the backup you took first. Our guide on restoring a WordPress backup while the site is down walks through it.

FAQ

Will pushing staging to live delete my new comments?

If the push includes the database, yes. Comments are stored in the database, and replacing live's database with the staging copy removes any comments made after the copy was taken. Pushing only files does not affect comments.

Is it safe to push only files from staging to live?

It is much safer, because files do not contain your comments, users or posts. Copy only the theme or plugin folders you changed, keep a renamed copy of the old folder, and never copy the whole wp-content folder, which includes live's uploads.

Can I merge a staging database into a live database?

WordPress core has no tool that merges two databases. Tools > Export and Tools > Import can move posts and pages selectively, and settings can be repeated by hand. Anything described as a merge deserves testing on a backup copy first.

Does Tools > Export include my images?

The WordPress.org documentation lists posts, pages, custom post types, comments, custom fields, terms and users as the export's contents. Image files are not in that list, so plan to upload new images on the live site.

How do I avoid the problem next time?

Keep staging short-lived. Refresh it from live right before you start work, keep a written list of every change, and move the changes soon after testing, so the gap between the two sites stays small.

Wpnotar Editorial
Wpnotar Editorial
Articles: 73

Leave a Reply

Your email address will not be published. Required fields are marked *