You’ll need an FTP client and a text editor for this process.
Step 1: Export Content Using Built-in WordPress Tools

On the live server, log in to the WordPress dashboard, activate the theme used locally, and go to Tools > Import. If prompted, install and activate the WordPress Importer plugin. Then, upload the XML file you exported. This transfers posts, pages, media, and menus, though you may need to reassign menu locations and widgets manually.

Step 2: Move Database from Local Server to Live
1. Export Database File

2. Modify File Paths
http://localhost/
. These must be updated to the live server’s URL. Open the exported `.sql` file in a text editor (e.g., Notepad++) and perform a find-and-replace. For example, replace http://localhost/my_test
with http://www.yourdomainname.com/my_test
(or http://www.yourdomainname.com
if installing at the root). Save the file without altering other content.

3. Create New Database on Your Hosting Account

4. Upload Database File to New Database

5. Update wp-config.php File
wp-config.php
file from your local WordPress installation in a text editor. Update the following lines with the new database credentials from Step 3:
define('DB_NAME', 'your_database_name'); define('DB_USER', 'your_database_user'); define('DB_PASSWORD', 'your_database_password'); define('DB_HOST', 'localhost');
Use the server IP address for DB_HOST
if specified by your host; otherwise, keep it as localhost
. Save a backup of the original file, then save and close the updated file.
6. Upload Website Files
public_html
or www
directory (or a subfolder if applicable) and upload all files from your local WordPress installation folder to this directory.
7. Modify Permalinks
Source: wpexplorer.com
If you encounter issues migrating your WordPress site from localhost to a live server, please comment below, and I’ll provide the best solution.
very helpful…:)
it's saved my a lot of time..thanks for the article
thanks it helps me a lot
OH NO! Don't do search/replace to your DB!
From WordPress' documentation: "If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break."
https://codex.wordpress.org/Moving_WordPress