Family Encyclopedia >> Electronics

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

As seasoned WordPress experts with years of hands-on experience helping developers launch sites, we recommend building locally first using tools like WAMP for Windows or MAMP for Mac. Once perfected, migrating to a live server is straightforward. This detailed guide walks you through the manual process, drawing from our proven methods used by thousands successfully.

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

While plugins like Duplicator or BackupBuddy simplify this (see our Duplicator guide), understanding the manual steps builds essential knowledge and troubleshooting skills.

Before You Start

To migrate your local WordPress site, ensure you have full access to it, a domain name, and reliable web hosting. Our top pick: Bluehost, an official WordPress-recommended host offering 60% off + free domain for our readers. Need setup help? Check our complete website setup guide.

You'll also need an FTP client like FileZilla. Ready? Let's begin.

Step 1: Export Your Local WordPress Database

Open phpMyAdmin at https://localhost/phpmyadmin/, select your WordPress database, and click Export in the top menu. For most cases, choose Quick method and hit Go to download the .sql file. (Learn more in our phpMyAdmin guide.)

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Step 2: Upload WordPress Files to Live Server

Connect your FTP client to your hosting account. Upload all local WordPress files to the root directory (e.g., public_html for yoursite.com).

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Step 3: Create MySQL Database on Live Server

In cPanel, go to MySQL Databases. Create a new database, then add a user and grant all privileges.

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Step 4: Import Database to Live Server

In cPanel's phpMyAdmin, select your new database, go to Import, choose your .sql file from Step 1, and click Go.

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Step 5: Update Site URLs in Database

In phpMyAdmin, open the wp_options table (or your prefixed version). Edit siteurl and home options, replacing localhost URLs (e.g., https://localhost/test) with your live URL (e.g., https://www.yoursite.com).

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Step 6: Configure wp-config.php and Finalize Settings

Via FTP, edit wp-config.php with your new database details (name, user, password from Step 3). Upload and visit your site.

Log in to WordPress admin: Save Settings » General and Settings » Permalinks without changes to refresh URLs site-wide.

Step 7: Fix Broken Images and Links

Run this SQL query in phpMyAdmin (replace URLs accordingly):

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

Alternatively, use the Velvet Blues Update URLs plugin. Test thoroughly; see our WordPress errors guide for issues.

How to Migrate WordPress from Localhost to Live Server: Proven Step-by-Step Guide

Your site is now live! For frequent migrations, Duplicator or BackupBuddy saves time. Subscribe to our YouTube channel, follow on Twitter and Facebook for more expert tips.