This tutorial will help you move your WordPress website from any sub-domain to the main domain (http://domain1.com/wp/ to http://domain1.com/) in 5 simple steps without any downtime.
It will also work for moving your WordPress to different domain (http://domain1.com/ to http://domain2.com/). The procedure would be exactly the same.
You will need access to your cPanel account and WordPress Dashboard.
I have my WordPress running at: http://domain1.com/wp/ and I would like to move it to http://domain1.com/
Please replace any occurrences of http://domain1.com/wp/ and http://domain1.com/ with the actual folder and domain you are moving.
Step 1: Change WordPress's WordPress Address (URL) and Site Address (URL)
Step 2: Login to cPanel and open the File Manager to the WordPress's Document Root
Step 3: Copy the Files from http://domain1.com/wp/ to http://domain1.com/
Step 4: Search and Replace all occurances of http://domain1.com/wp with http://domain1.com
Step 5: Redirect http://domain1.com/wp/ to http://domain1.com/
Step 1: Login to the WordPress Dashboard, go to Settings >> General and change WordPress Address (URL) and Site Address (URL) to http://domain1.com and click Save Changes at the bottom:
Step 2: Login to cPanel and open the Document Root of domain1.com:
Note: Make sure that "Show Hidden Files" is selected.
Step 3: Enter the wp folder, Select All and Copy the files to domain1.com's Document Root
Step 4: Install the WordPress plugin: Better Search Replace:
Click on Activate, once the installation is completed.
To replace all occurances of http://domain1.com/wp with http://domain1.com go to:
Dashboard >> Tools >> Better Search Replace:
Search for: http://domain1.com/wp
Replace with: http://domain1.comhttp://domain1.com
Select tables: Select all tables. Select multiple tables with Ctrl-Click for Windows or Cmd-Click for Mac or click on the top one, then hold SHIFT and click on the last one.
Run as dry run to check the results beforehand.
Next: Run Search/Replace
Step 5: Add 301 redirection in cPanel from: http://domain1.com/wp/ to http://domain1.com/:
If you are moving from different folder then /wp/ then you will be able to setup Wildcard redirect, which redirect all of the files in a directory to the same filename in the redirected directory, however this will not work when moving from http://domain1.com/wp/ to http://domain1.com/
Once you are sure the move was successful, go ahead and delete the /public_html/domain1.com/wp folder from the cPanel.
Feel free to contact us via the Open Ticket within your MyKualo client area if you need further assistance.