How to move Wordpress to the root directory - eHost

How to move WordPress to the root directory

Domain WHOIS Protection
WHOIS Protection on Domains
September 15, 2017
Make website responsive
How to make your website responsive with Site Builder
February 26, 2018

Have you ever installed WordPress with popular plugins that usually are available on cPanel and Direct Admin panels such as Installatron or Softaculous? These plugins let’s you install WordPress via a few clicks without you downloading the program, unzipping it, setting up a database and going through the install process manually.

Well, these plugins are great but a lot of clients that are not familiar with WordPress install it into a sub folder rather in the root directory and normally only realize this problem when trying to make the website live. For instance when using Softaculous the default sub directory is set to (www.mydomain.com/wp) and when using Installatron this is set to (www.mydomain.com/blog).

Now, this guide is going to show you how to easily make your website live in the root directory without a hassle and using backup/restore plugins such as Backbuddy or anything similar.

Step 1

First, login via cPanel and click on the File Manager icon.

Wordpress migration

Step 2

Double click on public_html

wordpress migration

Step 3

Go into the sub direct where WordPress is installed and click on Settings and select Show hidden files. This is very important because the .htaccess file is hidden.

cPanel Settings

Step 4

Select the index.php and .htaccess files by holding down Ctrl and clicking on the files one by one, click on Copy. Choose the folder you would like to copy these files to (remove the sub directory) and click on the Copy File(s) button. Then click on the Up one Level button to go to your root directory where you have copied the 2 files.

Step 5

Click on the index.php file and choose Edit.

Edit index.php using cPanel

Then change the following line: (change wp to your sub directory where WordPress is installed)
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );

TO

require( dirname( __FILE__ ) . ‘/wp/wp-blog-header.php’ );

Step 6 – The Final Step

Login to your WordPress website, click on Settings > General and remove the sub directory (wp) from the Site Address (URL) setting.

Wordpress - Change Site Address