How to Move a WordPress Site to a Subdirectory

The wordpress site is installed in the root directory of the hosting server on which it has been kept. The url of the site depends upon the directory in which it has been installed. In this tutorial, we will teach you how to move wordpress to subdirectory and do the necessary changing in site’s settings.

Step 1 – Open General Settings

First of all, go to the Settings tab located on the left hand side of the dashboard and click on the “General “option from the drop down menu.

Go to General Settings

Step 2 – Change the General Settings

Once done, the General Settings page will open up. In this page, go to the WordPress Address Field and insert the name of the wordpress subdirectory with a forward slash in which you want to move the site.
Let it be “sub” in our case.
With that done, go to the next field of “Site Address”. Over here, modify the previous path to the new one by replacing “/ wordpress” to “/ sub”.
Sub is the same directory in which we plan to move the site.
Now scroll down to the bottom of the page and click on the save changes button.

Enter the sub directory address

Step 3 – Error Message would be displayed

You will get an error message on the wordpress page when you’ll try to save the changes. Just ignore this error for now.

Server’s Error

Step 4 – Create a Sub Directory

Now we have to move wordpress to subdirectory which we have specified in the site’s settings. For that, navigate to the root directory which contains the wordpress folder.
In this location, create a new folder, name it sub and move your wordpress folder into this one.

Move wordpress to a subdirectory

Step 5 – Refresh the page

Once you are done, go back to your wordpress page which was displaying an error. Refresh the page by pressing the F5 key. A login screen will appear where you will have to enter the credentials before you hit the enter key.
Once you are done, your wordpress site will be up and will be running as smoothly as before. This is how we can move wordpress in subdirectory.

Login to the site