How to Move WordPress From Local Server to Live Site

Stuck while Moving your WordPress website to a live server? Follow these six simple steps, which will to help you through the process.

Most of the people like to develop the site locally in their computer using XAMPP/WAMP/WAMP server because it increase the speed of development and also they don’t have to upload updated file every time. But they face a major issue while uploading the finished site into the live server. So here is a Step By Step Guide to Migrating Your WordPress Website to a New Web Host.

Step 1: Upload full WordPress site in live server

ftp upload
First of all you have to upload the full site in to the live or hosting server through FTP Client. Don’t know how to upload file using FTP Client Read this.

Step 2: Export Local WordPress Database

export from phpmyadmin
After uploading all the files you have to export the full database from your local phpmyadmin.

Step 3: Change Site URL and Broken Links

find and replace
Now open this SQL file in any text editor, say for example NetBeans. Now open “find and replace” (or press Ctrl+H) type http://localhost/wp-theme in Find What and write you domain name say for example “http://yourdomainname.com” in Replace with; and then click Replace All and Save that SQL file. Now you database file is ready.

Step 4: Upload the Database.

Now upload the new database in the database of your hosting provider. Don’t know how to do this Read this.

Step 5: update wp-config.php

Open the wp-config.php in any text editor. And update following code

  • DB_NAME with your new database name
  • DB_USER with your new database username which all the privileges.
  • DB_PASSWORD with your new secure password you created for your MySQL user.
  • DB_HOST with you new host name, in most of the cases it remains localhost.
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp_theme');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', ");

/** MySQL hostname */
define('DB_HOST', 'localhost');

Step 6: update .htaccess file

Now you have to remove some of the unwanted code from the .htaccess file.

# BEGIN WordPress
RewriteEngine On
RewriteBase /wp-theme/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp-theme/index.php [L]
# END WordPress

Delete /yousitename as in my case it is /wp-theme and the new file would look like this

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Hopefully by now your live site is up and running. Checkout your site to make sure every thing is working as expected. For troubleshooting and questions feel free to leave us a comment below and I will try to help out as soon as possible.

Raunak Gupta

Raunak Gupta

I'm Raunak Gupta, a seasoned software developer with over 9 years of experience in a wide range of programming languages, frameworks, and tools. I started my journey as a WordPress & CakePHP developer in 2014, diving deep into the world of OOPs, Request handling, and SEO. Along the way, I crafted numerous dazzling WooCommerce stores, tamed payment gateways, optimized for full filament functionality, and achieved ultra-low latency for lightning-fast load times. My expertise extends to BI tools, website builders, DevOps, and team leadership. I like to help upcoming developers, so I share my experience through this blog and by assisting fellow developers on Stack Overflow, where I've earned a stellar reputation with over 10k+ points of recognition.

Articles: 29

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *