WordPress is installed in a subfolder, and the home page is shown on a subpage of the domain. How do we move it to the root folder?
1. It is important to first create a WordPress backup, i.e. a safety copy.
a) After logging in to the control panel, select Backup Wizard
b) You will be asked whether you want to back up or restore. On the left, select Back Up
c) In the next step, you are asked whether you want to create a full or a partial backup (Full Backup / Partial Backup). Select Select Partial Backup and Home Directory
d) In the last step, simply confirm your choice by clicking Home Directory and the file download will begin.
e) Repeat the procedure, but this time select MySQL Databases to also create a backup of the database.
2. Before moving the files, you need to change the URLs in the WordPress dashboard. They are currently set to the /wp subpage, which we must correct first. In WordPress, go to Settings > General. The following is displayed:
3. Delete the part that indicates the subpage. In the example above, this is /wp. It should look like this:
4. In the cPanel control panel, go to File Manager and navigate to the folder where you installed WordPress. On the right, select all the files and click Copy at the top.
5. After you click Copy, the dialog below appears. Choose the destination for the files. To do this, delete everything that comes after public_html. Clicking Copy File(s) starts moving the files one folder up.
6. Go back to the WordPress dashboard (the login address is now e.g. primer.si/wp-admin and no longer primer.si/wp/wp-admin), go to Settings > Permalinks and check the link structure to make sure it is correct. The links should no longer contain /wp. In our example, one of the permalinks would look like this: http://primer.si/sample-post/
7. In the last step, you still need to update the URLs in the database. The easiest way to do this is with a plugin. Several are available for this purpose; in our example, we will use Search & Replace. Select the options as shown in the image below (if your website is redirected to https, enter the address with https) and click Do Search & Replace
You have successfully moved your WordPress website to the root folder. The home page is now available directly on the domain rather than on a subpage of it.