There was a problem loading the comments.

How to move WordPress from a subfolder to the root folder (cPanel)

Support Portal  »  Knowledge Base  »  Viewing Article

  Print

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

f83e032b3ee397758bd676bd752512c68427b8a2?t=4417bd33b26e75d3dc526ce84a19321c



b) You will be asked whether you want to back up or restore. On the left, select Back Up

1463f056a2eeacc2de44d3b2d6fbeca3fc80d593?t=9314ca55741fe4dc326b8dad797b5785



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

98720c676be70d31000b8e0ddb7022f901a2b816?t=48f3f5c494196b2687d3d9e48a6a59e2



d) In the last step, simply confirm your choice by clicking Home Directory and the file download will begin.

d612f2dcbd923c9b621433c25123ffdb054d9145?t=c91b2d9b4e1f4dd384a4e9615acf03d1

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:

17d6e13cb25a526b0bb2b590014b2b5a8f3bf1e4?t=a8c6a2bfc40873366017403445d5c49b



3. Delete the part that indicates the subpage. In the example above, this is /wp. It should look like this:

afc845ad425cd30aabbe3223f197fad6f0d5cc79?t=610f5c453bbf15dfab3dd006799e5a3b



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.

4f087418abb34e9b7722f5f4af70207eddac26f3?t=a252508f67c8504d1d15cfb1f0b87806



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.

b3e43a2760218377935db09a96468e1be716f46f?t=0b90489025e1f7f9f74af47383900b10
44722f49123b44cb51721e5d3170e882ad4eb8af?t=1c3c59ff60855e38c7ac7a6e07e1b584



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/

830dbe388e8debd9fd3ee25fd759213513c0770c?t=af41f91363238fb7e9bd783caf015ed5



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

9d39b372022ffd55c3715eb43d6dfd093518d8e7?t=f5e83a43c584e8901937a416556b0de2

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.



Share via

Related Articles


Self-Hosted Help Desk Software by SupportPal

Tags

© Humanfrog