WordPress multisite users install the WordPress on a subfolder due to several reasons, but if you have purchased YouStable affordable SSD hosting, and planning to move it on the main folder, then you can do it. In this tutorial, we are going to list down one of the simplest ways to move a WordPress installation from subfolder to the main folder.
1. Move WordPress Multisite Data
YouStable web hosting company is offering fully functional cPanel as a control panel. We have sent an email from our official email address with cPanel credentials information in it.
Step 1: We assume that you have successfully logged into the control panel and type “file manager” in the search bar. Click on the first search result “file manager,” and it lands the users on the root folder.
Step 2: Find the subfolder from the root directory to select it. The contents in the subfolder are visible and click on the “select all” option to pick every folder & file for moving it to the main folder.
Step 3: Click on the move button to start working on the process, and a small confirmation window will open. The website founder has to decide the root folder location (remove the subfolder name and leave “/” only) and click on the “MOVE” button.
It takes a few moments for the web hosting servers to move entire site files from one folder to root folder.
2. Edit Database Configuration
The database pointing the domain, files, folders, etc to the old location and we have to edit them. You have to edit the files as a text document and remove the old location to the root directory.
Note: If the old location is “example_wp” then you have to replace it with “/,” and that is all. You can find all files in the WP installed folder by searching for it manually or by using the search bar.
Note: You can use a search shortcut to find out the exact location of the codes and replace them with suggested ones.
- Find “wp_options” in the site files and locate “siteurl.” Replace the domain name from “Domain.com/subfolder” to “Domain.com.”
- Locate “wp_#_options” and replace the subfolder name “Domain.com/subfolder” to “Domain.com.” You have to change only two values, and they are Siteurl and Home.
- Locate “wp_site” and change the paths from “/subfolder/” to “/” and that is all.
- In the “wp_sitemeta,” you have to repeat the same path changing process from “Domain.com/subfolder” to “Domain.com.”
- Find “wp-config.php” and change the paths from subfolder name to root folder.
All values are edited, but you have to edit the .htaccess file later on.
3. Edit WordPress Multisite .htaccess File
In this case, you might have to edit the .htaccess file multiple times because the configuration might have more than one Rewrite Base.
We have shared a snapshot above that describes the changing of the paths, and the name is identical to the subfolder name. Make sure to go through the entire file to ensure that there is no Rewrite Base left in the file.
Transferring multisite to the main root directory does not take more than ten minutes. It appears complicated visually, but on the flip side, it does not take more than a few minutes to complete. Apparently, the majority of the web hosting companies offer strong server. YouStable is a web hosting company offering SSD storage space packages at affordable prices including customer support.