Move a WordPress website from localhost to live Server

To Host a WordPress website in the Live Server from the localhost we have frequently faced some difficulties, it occurred mainly due to our local MySQL database information. During installation of WordPress in our localhost our MySQL database saves the localhost server information like host address. so when we try to transfer our WordPress site from localhost or other server to Live Server our website doesn’t work properly. To overcome these difficulty we need to follow some procedure. let’s discuss it bellow

Firstly, we need to copy all the necessary WordPress website files (including theme and plugins) to the live server via FTP/FTPs

Secondly, export database of that WordPress site from localhost MySQL and opened it with text editor (like notepad++, sublime text 3 etc.). then replace all the paths from “http://localhost/name_of_your_site” to “http://donaim-name/

Third, after fixing the paths import that database to live sites database. now your WordPress website at live server is ready to use

Fourth, If your site returns some error like index error: paths not found then you need fix the site and home paths by going WP dashboard->setting->general settings edit two field with your server site address “WordPress Address (URL)” and “Site Address (URL)”

Or add the following two lines in the wp-cofig.php file and save it.


N.B. if you add those two lines of code in your wp-config.php file remember you can’t edit the dashboard->setting->general settings fields anymore.

Fifth, If pages and posts of the WordPress are not appears correctly or returns some error like “index error: wordpress/index.php not found” then just simply edit the .htaccess file in the WordPress home folder and fix overwrite path from “localhost_filename/index.php” to “live_server_filename/index.php”

Finally Done! enjoy your live WordPress website visiting….