Pushing a WordPress staging site to live usually means copying everything over, which can overwrite newer posts, orders, or user registrations on production. This guide shows you how to selectively deploy only your code changes—themes, plugins, and uploads—while preserving your live database. You’ll use a migration plugin or manual file transfer, plus a few safety checks, so your live site keeps its current content intact.
What You’ll Need
- Access to your staging site’s admin dashboard (wp-admin).
- Access to your live site’s admin dashboard.
- FTP/SFTP credentials or a file manager in your hosting control panel for both sites.
- phpMyAdmin or a database management tool (only if you need to merge databases manually).
- A migration plugin like WP Migrate DB (or a similar tool that allows excluding tables) if you prefer a plugin-based approach.
Step-by-Step
- Back up your live site completely. Before touching anything, create a full backup of your live site’s files and database. Use your hosting backup tool or a plugin like UpdraftPlus. Store the backup off-server.
- Identify what changed on staging. List the themes, plugins, and custom code you updated or added on staging. Note any new plugins or theme files you want to bring over. Do not include database changes (like new posts or settings) unless you plan to merge them carefully.
- Download the changed files from staging. Using FTP/SFTP, connect to your staging site and download the folders for the theme and plugins you updated. Typically these are in
wp-content/themes/andwp-content/plugins/. Also download any new files inwp-content/uploads/that you want to keep (e.g., images added on staging). - Upload the files to your live site. Connect to your live site via FTP/SFTP and upload the downloaded theme and plugin folders, replacing the existing ones. For uploads, add the new files without deleting existing ones—just merge the folders.
- Activate the updated plugins and theme on live. Log into your live site’s wp-admin. Go to Plugins and Themes. Activate any new plugins you uploaded. If you replaced a theme, activate it. Check that the site still loads correctly.
- Handle database changes selectively (if any). If your staging changes included new options, custom post types, or plugin settings that are stored in the database, you need to migrate only those specific rows. Use a plugin like WP Migrate DB (with the “find & replace” and “exclude tables” features) to export only the relevant tables from staging and import them into live, but beware of overwriting live data. A safer approach is to manually replicate the settings on live via the admin UI.
- Clear caches. After updating files, clear any caching plugins (like WP Super Cache or W3 Total Cache) and server-side caches (like Memcached or Varnish) on your live site. Also clear your browser cache.
- Test thoroughly. Visit key pages on your live site: homepage, a post, a product page (if WooCommerce), and your admin dashboard. Check that forms, menus, and custom functionality work. Verify that recent live content (posts, orders) is still present.
Common Mistakes
- Copying the entire staging database over live. This is the #1 cause of data loss. Always exclude live-specific tables like
wp_posts,wp_comments, andwp_usersunless you know exactly what you’re doing. - Forgetting to back up live before starting. Even a file-only push can break something. Always have a restore point.
- Overwriting uploads folder. If you upload the entire
uploadsfolder from staging, you may delete images that were uploaded directly to live. Merge folders instead of replacing. - Not checking for hard-coded URLs. If your staging site is on a different domain, any URLs stored in files (e.g., in theme options) might point to staging. Use a search-replace tool or manually update them.
- Skipping cache clearing. Old cached files can make it look like nothing changed, or worse, cause mixed content errors.
Tips
- Use a version control system like Git for your theme and plugin code. This lets you push changes with a simple
git pullon the live server without touching the database. - If you’re using a managed WordPress host (like WP Engine or Kinsta), they often provide a one-click staging-to-live push that lets you choose whether to include the database. Use that if available.
- For plugin updates, consider updating plugins directly on live instead of via staging, unless you have custom modifications.
- Keep a changelog of what you changed on staging so you can replicate settings manually on live.
- Test the push on a second staging site first if you’re unsure.
Troubleshooting
- Site shows a white screen after uploading files. This usually means a PHP error. Check the error log in your hosting panel. Common causes: incompatible plugin version or missing dependencies. Restore the backup and try uploading files one by one.
- New posts from live disappeared. You likely overwrote the database. Restore the live database from the backup you made, then re-apply only the file changes.
- Links still point to staging. Run a search-replace on the live database (using WP CLI or a plugin) to replace the staging URL with the live URL. Be careful to only replace in the
guidand content fields, not in serialized data unless using a proper tool. - Plugin settings didn’t carry over. If you didn’t migrate the database, settings won’t transfer. Manually configure the plugin on live, or export/import the specific option rows using a database tool.
- Uploads missing. You may have replaced the uploads folder instead of merging. Restore the live uploads from backup and then add the staging files individually.
Frequently Asked Questions
Can I push only the theme and plugins without affecting the database?
Yes, that’s the core of this guide. Upload the theme and plugin files, but do not import the staging database. The live database remains untouched.
What if I need to push database changes like new custom post types?
You can export only the specific tables or rows from staging and import them into live, but be cautious. For custom post types, it’s often easier to recreate the post type registration in code and then manually add the content on live.
Is it safe to use a migration plugin for this?
Yes, but choose a plugin that allows you to exclude tables. WP Migrate DB Pro, for example, lets you select which tables to export. Always back up live first.
How do I handle changes to the WordPress core files?
WordPress core updates should be done directly on live, not via staging. If you modified core files (not recommended), you should reapply those changes manually on live.
What about changes to the .htaccess or wp-config.php?
These files are environment-specific. Never copy them from staging to live. Instead, make the necessary changes manually on live, respecting the live server’s configuration.
Can I automate this process?
Yes, with a CI/CD pipeline using tools like GitHub Actions and WP-CLI, you can deploy code changes to live automatically while leaving the database alone. This requires a Git-based workflow.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Cool Raspberry Pi Projects: 15 Ideas for Any Skill Level3
- Terraform vs Kubernetes: Key Differences
- China’s IPv9 Decimal Network Project Explained
- Fix Wired Earbuds That Only Work in One Ear
- What to Check Before Buying the Dip in Indian Shares
- Internet Connectivity in Remote Areas: Options0.80 USD/GB