Skip to main content

WPCraftEngineer – Build Fast, Secure & High-Performance WordPress Websites

How to Move a WordPress Website from Staging to Live Without Errors

Have you finished designing your WordPress website on a staging environment and are ready to make it live? Moving a website from staging to production is an important step, but doing it incorrectly can cause broken links, missing images, database errors, or even website downtime.

A staging website allows you to test design changes, themes, plugins, and new functionality without affecting your live website. Once everything is ready, you need to transfer the approved changes to your production website carefully.

In this guide, you’ll learn how to move a WordPress website from staging to live step by step, including website backups, database migration, URL replacement, SSL configuration, DNS settings, and final launch checks.

Whether you’re using Hostinger, cPanel, or another hosting provider, these steps will help you complete the migration more safely.

What Is a WordPress Staging Website?

A WordPress staging website is a separate copy of your live website that you can use for development and testing.

It usually contains:

  • WordPress core files.
  • Your active theme and plugins.
  • Website pages and posts.
  • Media files and uploads.
  • Database settings and configurations.

For example:

  • Staging website: https://staging.example.com
  • Live website: https://example.com

You can make changes on the staging website, test everything, and then transfer the approved changes to your live website.

This approach helps prevent visitors from experiencing unfinished designs, broken features, or development errors.

Why Should You Move Your WordPress Website from Staging to Live?

Moving your website from staging to live is necessary when your development and testing work is complete.

Here are some common reasons:

  • Launching a newly designed website.
  • Publishing updated website pages.
  • Releasing a new WordPress theme.
  • Installing and configuring new plugins.
  • Launching new WooCommerce functionality.
  • Updating website layouts and features.
  • Replacing an existing website with a redesigned version.

However, before starting the migration, make sure your staging website is fully tested and ready for visitors.

Things to Do Before Moving WordPress from Staging to Live

Before transferring your website, prepare both environments.

1. Create a Complete Website Backup

The first and most important step is creating a backup of your existing live website.

Your backup should include:

  • Complete WordPress files.
  • WordPress database.
  • Themes and plugins.
  • Media uploads.
  • Configuration files such as wp-config.php.
  • Custom code and additional files.

You should also create a separate backup of your staging website.

Keep these backups somewhere outside the hosting account if possible. This gives you a recovery option if something goes wrong during migration.

Important: Never overwrite your live website without creating a backup first.

2. Check the Staging Website

Before migration, review the staging website carefully.

Check the following:

  • All pages are displaying correctly.
  • Navigation menus are working.
  • Images and media files are loading.
  • Contact forms are functioning.
  • Mobile and desktop layouts are responsive.
  • Plugins and themes are working correctly.
  • No unnecessary development content is visible.
  • There are no major PHP errors.
  • Important website functionality has been tested.

If you use Elementor or another page builder, check the layouts and responsive settings on different screen sizes.

3. Check Your WordPress and PHP Versions

Make sure the live hosting environment supports the WordPress version, PHP version, theme, and plugins used by your staging website.

A difference between staging and production server configurations can cause unexpected errors after migration.

Also check:

  • PHP memory limit.
  • Maximum upload size.
  • Database version compatibility.
  • Required PHP extensions.
  • Server configuration.

How to Move a WordPress Website from Staging to Live

There are different ways to migrate a WordPress website. You can use your hosting provider’s staging tool, a migration plugin, or a manual migration process.

The following steps explain the manual method so you understand what happens during the migration.

Step 1: Prepare Your Live Website

Log in to your hosting control panel and open the directory where your live WordPress website is installed.

Common examples include:

  • public_html
  • public_html/example
  • A custom document root configured by your hosting provider.

Before uploading anything, create a complete backup of the existing live website.

If you are replacing an existing website, make sure you know which files and database belong to the production installation.

Avoid deleting the old website files until the new website has been tested successfully.

Step 2: Download WordPress Files from Staging

Open your staging website’s hosting file manager or connect using FTP/SFTP.

Download the WordPress installation files.

Important folders and files include:

  • wp-admin
  • wp-content
  • wp-includes
  • wp-config.php
  • .htaccess
  • Other WordPress root files

The wp-content directory is particularly important because it contains your themes, plugins, and uploaded media files.

You can download the files using:

  • Hosting File Manager.
  • FTP/SFTP software.
  • Your hosting provider’s backup or migration tools.

Keep the downloaded files organized so you can upload them to the correct production directory.

Step 3: Export the Staging Database

Your WordPress database stores website content, settings, users, menus, plugin configurations, and other important information.

To export it:

  1. Open phpMyAdmin from your hosting control panel.
  2. Select the staging website’s database.
  3. Click the Export option.
  4. Select the Quick export method if suitable.
  5. Choose SQL as the format.
  6. Download the database file.

Save the exported SQL file securely.

Important: Your staging database may contain test users, test orders, or outdated content. Review what you are transferring before importing it into production.

Step 4: Upload the WordPress Files to the Live Server

Now upload your staging website files to the live website’s document root.

You can use the hosting File Manager or FTP/SFTP.

If you are replacing an existing installation, make sure you have identified the correct destination directory.

After uploading, verify that the following files and folders are present:

  • wp-admin
  • wp-content
  • wp-includes
  • wp-config.php
  • .htaccess

Do not overwrite or remove files blindly. Some production-specific configuration files may need to be preserved or adjusted.

Step 5: Create or Select the Production Database

Open your hosting control panel and navigate to the MySQL database management section.

You may need to:

  1. Create a new database.
  2. Create a database user.
  3. Assign the user to the database.
  4. Grant the required database privileges.
  5. Save the database name, username, and password.

If you are using an existing production database, make sure you understand which data will be replaced before importing anything.

Step 6: Import the Staging Database

Open phpMyAdmin and select the production database.

Follow these steps:

  1. Select the correct production database.
  2. Open the Import tab.
  3. Choose your exported staging SQL file.
  4. Select the SQL format if required.
  5. Start the import process.
  6. Wait for the import to finish.
  7. Verify that the expected WordPress tables are present.

If the database is large, you may need to use your hosting provider’s database import tool or command-line access.

Important: Importing a complete staging database can overwrite existing production content, users, comments, and other records. This is especially important for WooCommerce websites, where new orders and customer information may have been added to the live database after the staging copy was created.

For an active online store, do not blindly replace the entire production database. Use a migration or deployment process that preserves live orders, customers, and other important production data.

Step 7: Update the Database Configuration

After importing the database, update the database details in your live website’s wp-config.php file.

Check these configuration values:

define( 'DB_NAME', 'production_database' );
define( 'DB_USER', 'production_username' );
define( 'DB_PASSWORD', 'your_database_password' );
define( 'DB_HOST', 'localhost' );

Replace the example values with the actual database credentials supplied by your hosting provider.

Your database host may be different from localhost, so use the correct value provided by your host.

Also make sure the $table_prefix value matches the imported database tables.

Save the file after making the required changes.

Step 8: Replace the Staging URL with the Live URL

One of the most important migration steps is updating the website URLs.

For example:

Old staging URL:

https://staging.example.com

New live URL:

https://example.com

If the old staging URL remains in your database, you may experience:

  • Images loading from the staging website.
  • Internal links pointing to the wrong domain.
  • Broken page builder layouts.
  • Incorrect redirects.
  • Missing CSS or JavaScript resources.

You need to update the old URL references safely.

You can use a WordPress database search-and-replace plugin, such as Better Search Replace:

https://wordpress.org/plugins/better-search-replace/

Alternatively, if WP-CLI is available, you can use:

wp search-replace 'https://staging.example.com' 'https://example.com' --all-tables-with-prefix --dry-run

Review the dry-run results first. If the changes are correct, run the command again without --dry-run.

Important: Never use a basic SQL REPLACE() query for a blanket URL replacement across the entire WordPress database. Some themes and plugins store serialized data, and a plain replacement can break that data.

Also, do not change the guid column in the WordPress posts table as part of a routine URL migration.

Step 9: Verify WordPress Address and Site Address

Once the URL replacement is complete, check your WordPress URL settings.

Log in to your WordPress dashboard and navigate to:

Settings → General

Verify these two fields:

  • WordPress Address (URL)
  • Site Address (URL)

Both should contain your correct live website URL.

For example:

https://example.com

Make sure you use the correct HTTPS version and avoid adding a trailing slash.

If you cannot access the dashboard, you may need to check the home and siteurl values in the WordPress options table or use another documented recovery method.

Step 10: Configure SSL and HTTPS

Your live website should have a valid SSL certificate.

If SSL is not configured, visitors may see security warnings or encounter problems accessing your website.

Follow these steps:

  1. Open your hosting control panel.
  2. Navigate to the SSL section.
  3. Install or activate the SSL certificate for your domain.
  4. Verify that the certificate covers the correct domain and any required subdomains.
  5. Check that your website loads using HTTPS.
  6. Configure HTTP-to-HTTPS redirection where appropriate.

After enabling SSL, check your pages for mixed-content warnings.

Mixed content occurs when an HTTPS page loads some resources, such as images or scripts, over HTTP.

Step 11: Update DNS Records if You Are Changing Servers

If your staging and live websites are hosted on the same server and the live domain already points to that server, you may not need to change DNS records.

However, if you are moving your website to a different hosting provider or server, you may need to update your domain’s DNS settings.

Common DNS records include:

DNS Record Purpose
A Record Points a domain to an IPv4 address
AAAA Record Points a domain to an IPv6 address
CNAME Record Points one hostname to another hostname
MX Record Routes email for your domain

Before changing DNS records, check the exact values supplied by your hosting provider.

Important: Do not delete or overwrite your existing MX records or other email-related DNS records unless you intend to change your email service.

DNS changes can take time to become visible across different networks. Keep your old hosting account active until the new website and related services are working correctly.

Step 12: Update Permalinks and Website Caches

After migration, open your WordPress dashboard and navigate to:

Settings → Permalinks

Review your permalink structure and click Save Changes.

You usually do not need to change the permalink structure. Saving the settings can refresh WordPress rewrite rules.

Next, clear:

  • WordPress caching plugin cache.
  • Hosting-level cache.
  • CDN cache, if configured.
  • Browser cache.
  • Page builder generated CSS and files, if applicable.

This helps ensure visitors receive the latest website content and styles.

Step 13: Disable Staging Restrictions on the Live Website

Staging websites are often configured to discourage search engines from indexing them.

Before launching, check:

Settings → Reading → Search engine visibility

Make sure the option labeled “Discourage search engines from indexing this site” is unchecked on the live website, if you want search engines to index it.

Also check:

  • SEO plugin indexing settings.
  • Robots.txt.
  • Canonical URLs.
  • XML sitemap.
  • Noindex tags.
  • Any staging-only maintenance or password protection.

Do not automatically remove all security restrictions. Only remove settings that were intended specifically for the staging environment.

Final WordPress Website Launch Checklist

After completing the migration, test the live website before announcing the launch.

Use this checklist:

  • Homepage loads correctly.

  • WordPress admin login works.

  • All important pages are accessible.

  • Navigation menus work.

  • Images and media files load correctly.

  • Internal links point to the live domain.

  • Contact forms submit successfully.

  • Email notifications are working.

  • SSL certificate is valid.

  • HTTP redirects to HTTPS where required.

  • Permalinks are working.

  • No major PHP errors are present.

  • Caching is configured correctly.

  • Mobile and desktop layouts are working.

  • SEO indexing settings are correct.

  • XML sitemap is accessible.

  • WooCommerce checkout and payment flow work, if applicable.

  • Backup of the new live website has been created.

Once everything has been verified, you can safely announce your website launch.

Common Problems After Moving WordPress from Staging to Live

Even when migration steps are followed correctly, some issues may appear after launch.

Here are common problems and their possible solutions.

Problem Possible Solution
404 Page Not Found Save permalink settings and check rewrite rules.
Images Not Loading Check media URLs and upload files.
Database Connection Error Verify database name, username, password, and host.
Redirecting to Staging URL Check home, siteurl, and remaining old URL references.
SSL Not Working Verify certificate installation and HTTPS configuration.
Broken Page Builder Layout Regenerate builder files and check serialized URL replacements.
White Screen of Death Check PHP error logs, plugin conflicts, and PHP compatibility.
Contact Form Not Working Check form configuration and SMTP settings.
Website Showing Old Content Clear WordPress, hosting, CDN, and browser caches.

Special Considerations for WooCommerce Websites

Moving a WooCommerce website from staging to live requires extra care.

Unlike a simple business website, an online store may receive new orders, customer registrations, payments, and product updates while development is happening on staging.

If you replace the entire live database with an older staging database, you may lose:

  • Recent customer orders.
  • New customer accounts.
  • Order status changes.
  • Customer details.
  • Product inventory updates.
  • New reviews and comments.

For this reason, a full staging-to-live database replacement is not always the right approach for an active WooCommerce store.

A safer deployment process may involve transferring only the approved theme, plugin, code, and configuration changes while preserving production transactions and customer data.

Always create a fresh production backup and plan the deployment carefully before making changes.

Best Practices for a Safe WordPress Migration

Follow these practices whenever you move a WordPress website from staging to live:

  1. Always create a complete backup before migration.
  2. Test the staging website before deployment.
  3. Verify PHP and database compatibility.
  4. Use secure FTP/SFTP or your hosting provider’s migration tools.
  5. Update URLs using a serialization-aware search-and-replace method.
  6. Never run an unreviewed database replacement query.
  7. Preserve live customer and order data.
  8. Configure SSL and HTTPS correctly.
  9. Check DNS records before changing nameservers or IP addresses.
  10. Test forms, login, checkout, and important website features after launch.

Following these practices can reduce downtime and help prevent common migration problems.

Frequently Asked Questions (FAQs)

1. How do I move a WordPress website from staging to live?

Create backups of both websites, transfer the approved WordPress files and database, update database configuration and URLs, configure SSL, and test the live website. You can also use a hosting migration tool or a compatible migration plugin.

2. Can I move a WordPress staging site to live without a plugin?

Yes. You can migrate WordPress manually using your hosting File Manager, FTP/SFTP, phpMyAdmin, and a safe database search-and-replace method. However, manual migration requires careful handling of files, database settings, and URLs.

3. Will moving a WordPress website affect SEO?

It can affect SEO if URLs change, pages become inaccessible, redirects are missing, or search engines are blocked from indexing the live website. Keep important URLs consistent where possible, configure redirects when necessary, and verify your sitemap and indexing settings after launch.

4. Do I need to change DNS when moving a staging website to live?

Not always. If your live domain already points to the correct hosting server, you may not need to change DNS. If you are moving to a different server or hosting provider, update the relevant DNS records using the values supplied by your new host.

5. Why is my WordPress website redirecting to the staging URL after migration?

This usually happens when the old staging URL remains in the database, WordPress URL settings, plugin configurations, or cached files. Check the home and siteurl values and perform a safe search-and-replace operation.

6. How long does it take to move a WordPress website from staging to live?

It depends on the website’s size, database, hosting environment, and migration method. A small website may take less time, while a large website or active WooCommerce store requires additional preparation and testing.

7. Should I delete my staging website after migration?

You can remove the staging website once the live website is stable and verified. However, keeping a protected staging environment is useful for future updates, plugin testing, and development work.

Final Thoughts

Moving a WordPress website from staging to live is more than simply copying files. You also need to transfer the database, update website URLs, configure SSL, check DNS settings, and verify that every important feature works correctly.

The most important things are to create a complete backup, use a safe URL replacement method, and protect live customer and order data during migration.

By following this step-by-step guide, you can make the transition from staging to production more smoothly and reduce the risk of website errors.

Need professional help moving your WordPress website to live?

WP Craft Engineer provides WordPress development, maintenance, troubleshooting, and website support services to help keep your website secure and running smoothly.

Explore WP Craft Engineer and get professional help with your WordPress website.