Developing your WordPress website locally allows you to build and test your site in a controlled environment before going live. However, once your website is ready to be accessible to users, it’s time to move it from your localhost to a live server. This process may seem technical, but with the right guidance, you can transition smoothly and ensure your site functions perfectly on the internet.

In this guide, we’ll walk you through how to move WordPress from localhost to live server step by step. Whether you are using a local development tool or simply working on your WordPress site offline, our instructions will make it easy for you to upload your site to a hosting server. Along the way, we will also highlight some useful tools, such as a WordPress Theme Builder to customize your site’s appearance, and resources like How to Create a WordPress Theme to help you set up and manage your site effectively.

How to Move WordPress from Localhost to Live Server: Steps

Step 1: Export Local WordPress Database
Step 2: Upload WordPress Files to Live Site
Step 3: Create New Database on Live Site
Step 4: Import Local Database on Live Site
Step 5: Redirect the Site URLs
Step 6: Set Up Your Live Site
Step 7: Fix Images and Broken Links

How to move WordPress from localhost Prerequisite:

First of all, you need to test your local WordPress site on you XAMPP. Once you are satisfied with the design, and your website performance is good enough, it is the time you move your website to the live server.

  • Your WordPress website running on your local computer. You can check out our guide to installing XAMP and WordPress locally.
  • Make sure you online WordPress website is up and running. If not you require a domain name and a hosting plan to upload your WordPress website. You can check out the best WordPress hosting providers and choose the best fit for your website.
  • SFTP (Secure File Transfer Protocol) details for your hosting account. All good hosting provider these days offer free SFTP inbuilt into their panel.

How to Move WordPress from Localhost to Live Server

 

Methods to Move WordPress from Localhost to live Server and Publish Website

In this article I will cover two reliable methods to upload your WordPress to Live Server. The first is the manual method, where you’ll manually export your database, upload files via FTP, and configure your site on the server. This approach gives you full control over the process. The second method is using plugins, which automate much of the work and make the process faster and easier, especially for beginners. Both methods are effective, and I’ll walk you through each step so you can choose the one that best fits your needs.

So, you have two methods to move your website from localhost to a live server:

  1. Manual method
  2. Using Plugins
Pro Tip: This solution work for all Local Dev Environments
These steps apply to any environment, including XAMPP, WampServer, MAMP, LAMP, Vagrant, Docker, Laragon, and Studio.

1. Manual Method: How to move WordPress site from localhost to live Server

To move your WordPress site manually, you will first export it via phpMyAdmin.

Step 1: Export Local WordPress Database

For exporting your database, simply navigate to http://localhost/phpmyadmin/ and select your WordPress database. Next, click Export button from the top menu bar.

move wordpress from localhost to server export database

You will find two options here – Quick and Custom. Custom will give you more options to export your database.

move wordpress from localhost to server export database

If you are choosing Custom, make sure that all the tables get selected. Choose the gzipped form of compression for the output file. The gzipped compression is mainly used for large database files.

move wordpress from localhost to server export database

Under Format-specific options, select structure, and data. Also, check the following boxes:

  • Add DROP TABLE / VIEW / PROCEDURE / FUNCTION statement
  • IF NOT EXISTS
  • AUTO_INCREMENT
  • Enclose table and column names with backquotes

move wordpress from localhost to server export database

Once done, click Go button to download the database file.

Step 2: Upload WordPress Files to Live Site

To move your WordPress files, open your FTP client. For demonstration purpose, we are using FileZilla FTP client here. First, connect to your web hosting account and browse the root directory of your live server. Then, Upload all the files in the right destination directory. For example, if you want to host the site on mysite.com, then upload all files in public_html directory. You will get an inbuilt File Transfer feature on your CPanel if you are using a good Web Hosting.

move wordpress from localhost to server ftp transfer

Step 3: Create New Database on Live Site

Your WordPress files will take a while to upload, meanwhile import the database saved to your hard drive in the first step. Hosting providers offer different ways to do so. Some do it through phpMyAdmin & some via cPanel. The cPanel is more popular so we are creating a database via cPanel here.

First of all, log in to your cPanel dashboard. Click the MySQL Databases icon in the databases section. Good Hosting providers generally provide a direct link to the CPanel login in the first signup email, otherwise you can also find it from your hosting admin.

move wordpress from localhost to server create database

From the next screen, you will create a database by specifying its name.

move wordpress from localhost to server create database

After creating a database, navigate to the MySQL Users section. Here, create or add an existing user to the database.

move wordpress from localhost to server create database

cPanel will take you to set MySQL privileges for that user. Now, grant all privileges to the user by checking every box. Then, click Make Changes button.

move wordpress from localhost to server create database

Step 4: Import Local Database on Live Site

Go to your cPanel dashboard to import your WordPress database. Navigate to database section and select phpMyAdmin. Now, you can see your newly created database in phpMyAdmin. Go to Import page by clicking the Import Tab on the top bar menu. Next, click on Browse button to choose the database file created in step 1.

move wordpress from localhost to server import database Then, press Go to import your WordPress database.

Step 5: Redirect the Site URLs

Now, you have to replace all the links in the database contained inside are still pointing to the old site location. In phpMyAdmin, look for the wp_options table in your database. Click Browse button or the link in the sidebar to open the page with a list of fields within the wp_options table. Under the options_name file, you need to look for siteURL. Click Edit option that will open an edit field window.

move wordpress from localhost to server import database

In the input box for option_value, you can see the URL of your local install like http://localhost/test. Replace it with your new site URL in this field, for example, http://www.yourwebsite.com

move wordpress from localhost to server import database

Save the changes by clicking the Go button.

Next, you will repeat the same steps for the option name: home. So, simply find the home tab in the wp_options page. Update the home URL to be your site URL.

Refer to this detailed tutorial on how to change Mass URLs for a website.

Step 6: Set Up Your Live Site

Once you import the database, it’s time to configure wp-config.php. Connect to your website using an FTP client, find wp-config.php file and right click to View/Edit. Look for the information:

define(‘DB_NAME’, ‘your_database_name’);

define(‘DB_USER’, ‘your_database_user’);

define(‘DB_PASSWORD’, ‘your_database_password’);

define(‘DB_HOST’, ‘localhost’);

Update the database name, user name, and password you created in the earlier step. After that, save the wp-config.php file. Your website should be live now so you can log in. Move to Settings » General and without changing anything, Click  Save Changes button. It will ensure that the site URL is corrected wherever needed.

Pro Tip: Set Permalinks Structure:
Go to Settings → Permalinks, choose your preferred URL structure and save it to ensure all post links are working well.

Step 7: Fix Images and Broken Links

Whenever you move from local server to a live site, it is obvious to get some broken links and missing images. You can either use the SQL queries or use the Velvet Blues WordPress plugin to fix these.

If you choose SQL, go to phpMyAdmin. Click on your database and press SQL from the top menu. Write this query:

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

Replace the local site and live site URLs with your own.

That is it !! You have successfully migrated your site to the live server manually.

For a smooth start with your live WordPress site, check out our collection of free WordPress themes to give your site a professional look in no time.

Option2: Move WordPress Website to Live Server Using Plugins

The second most convenient and comparatively easier way to migrate your site is by using WordPress plugins. There are many plugins available in WordPress repository for the same. But two most reliable and popular plugins are All-In-One WP Migration and Duplicator. Let’s see the step by step procedure to transfer a site using both one by one:

All-In-One WP Migration plugin

All in one WP Migration is a very popular plugin with a good rating. It exports your WordPress website including the database, media files, plugins, and themes. You need no technical knowledge for this. The steps you will follow to migrate your site to a live server are as:

Step 1: Install and Activate the plugin.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin move wordpress site from localhost to live server with all in one wp migration wordpress plugin

 

Step 2: After activating it, you can see an option named All-in-One WP Migration in the left pane of your WordPress Dashboard. Click on Export and it will open an Export Site window as shown below.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin

Here, it will ask you about the format in which you want to Export your localhost site. Suppose you select File. then, it will prompt you to Download Localhost with information of file size as shown below.

Click Download Localhost.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin

Step 3: Now, log into cPanel. Install All-In-One WP Migration plugin from the dashboard of your live website. Activate it. Once activated, navigate to left pane of the dashboard and Click Import option under All-In-One WP Migration section.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin

Here, select the same format to Import the local site as selected in Step 2.

Step 4: Select the database file you created in step 2 from the browse button as shown below.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin

Step 5: It will prompt you before Importing the localhost file as shown below. If you have taken the backup of your site and sure to move it, click Proceed.

move wordpress site from localhost to live server with all in one wp migration wordpress plugin

That’s it!! Your site is live now. It is really simple to move your site from localhost to server with All-In-One WP Migration.

Duplicator WordPress Plugin

Duplicator is another one if the best migration plugins with best user rating. Let’s see how to use it to move your WordPress site from localhost to a web server:

Step 1: Download and Install Duplicator on your localhost site from the WordPress plugin repository.

move wordpress site from localhost to live server with duplicator wordpress plugin

Once installed, activate it.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 2: Now, you can see a Duplicator section in the left pane of your WordPress dashboard. When you click on Packages, it will display No Packages Found. As you have just installed the plugin and no packages are available here.
A package will include an archive and an installer file that automates the process of setting up your site on another server.

So, click “Create New” to create a package.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 3: The next screen will prompt to specify the name of your package and making a few notes. It’s not necessary to name your package, though you can give it a memorable title. Also, add a few notes if you want to.

There are also some optional Archive and Installer settings. The Archive settings allow you to filter your database. Whereas the Installer options are used to pre-fill the Installer screen to prepare setup at install time for future. It will speed up your overall install process.

Then, click “Next”.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 4: Duplicator will now run a system scan to ensure the smooth processing of package building. It will also determine the potential issues. More “Warn” checks indicates that you will run into issues during the build and install phases.

Now, press Build to create your package. It will start backing up your site.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 5: The plugin will produce two files after throwing a package completion message. These files are – an archive of your site as a .ZIP file and an installer file as a .PHP file. Download both files.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 6: Now, you need to install and unpack your packaged site. For that, you will copy the downloaded files in the earlier step to my live site’s directory. You can use an FTP application like FileZilla for this.

Step 7: Login to your site via FTP and navigate to your public_html folder. Copy the archive and installer files here from your desktop. It can take a little longer.

Step 8: Next, you will install the archived site on the live server. For that, access the installer by adding /installer.php to the domain. It will validate first, all the files copied.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 9: Then, the installer interface will prompt you to add your MySQL details. In case, you are only replacing an existing site, you will enter the existing database details. If you’re creating a new site, click “Create New”. Then, enter fresh database details. Make sure that you get a “Success” message for both the “Server Connected” and “Database Found” tests before moving on.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 10:. Next, it will Update Data for your live site.

move wordpress site from localhost to live server with duplicator wordpress plugin

Step 11: Your site is ready and you can test it by opening the front-end of your live site to check that everything is working fine.

move wordpress site from localhost to live server with duplicator wordpress plugin

That’s it !!

Which way you use to Move WordPress from Localhost to Live Server?

As you have seen, it is not that tough to move a WordPress site from localhost to a live server. It takes only a few steps to do all manually. Though using plugins, it is quite simpler. But, you should have enough knowledge to how to move WordPress from localhost to live server manually. When you are bearing the same pain to design a WordPress website, test it, and then to make it live, it should look beautiful and competitive enough.

Related reading: WordPress 101 tutorial

How to check WordPress version

How to find WordPress login url

How to install WordPress

What WordPress theme is that

How to change WordPress language

How to create WordPress custom login page

How to create WordPress theme from scratch

How to fix WordPress page update not working