How to move WordPress in subdirectory?

Move WordPress in subdirectory is an easy task. If the user has multiple sites hosted on one web hosting account, then moving the site from subfolder to root directory might come in handy. Users do not have to worry about incorrect configuration because changing a few lines will get the job done.

1. Move WordPress in subdirectory

We have to begin with moving the files from one folder to another folder or root directory. Anyone can do it by accessing the cPanel, and YouStable users do not have to scratch their heads. YouStable web hosting company offers cPanel as a control panel, and you can find the credentials in the registered email address.

Step 1: Login to the control panel and type “file manager” in the search bar to click on the first result.

Move WordPress

Step 2: Select the subfolder and then click on “select all” button.

Move WordPress

Step 3: I assume that you have selected all the files in the subfolder.

Move WordPress
  1. Select all the folders.
  2. Click on Move to start the process.
  3. Select the root directory or custom path. (Contact developer or customer care for more information. You cannot mess up on the path.)
  4. Click on “Move Files” to start the moving the files.

cPanel takes a few moments to move all files from one folder to another folder or root files.

2. Change Values

Now, you have to change the values of wp_options, wp_sitemeta, and wp_site.

  1. WP Options: You can find the file in the moved folder or old folder, and edit the page with http://yourdomain.com/subfolder to http://yourdomain.com.
  2. WP Site Meta: You have to change the site URL from http://yourdomain.com/subfolder to http://yourdomain.com.
  3. WP Site: Change the path from older folder path to the new path.
  4. WP Blogs: You have to change the paths of every old folder URL.
  5. WP # Options: Now, you have to remove the old folder path of site url and home.

End of the process. Make sure to contact the developer for further instructions or contact YouStable (existing or new users only) customer care for assistance.

3. Edit wp-config.php

In the final step, you have to inform the WordPress that there has been a major change. By editing the “wp-config.php” file, you can change the patch.

Old Code: define (‘PATH CURRENT STATE’, ‘/WP’);

New Code: define (‘PATH CURRENT STATE’, ‘/WP’ to ‘/’);

Find the old code that I have mentioned above, and replace it with the new code. However, make sure to mention the new path in the modified code.

Conclusion

Log out of the control panel, and then come back after a few minutes to check the changes. You might come across errors and it is a common issue, while the moving process takes place. Do not worry about the incorrect configuration because YouStable web hosting customer can get assistance from our team.

Leave a Comment