Are you trying to remove/WordPress/ from your website’s URL? Sometimes beginners end installing WordPress in a subdirectory, which causes /WordPress/ to appear in their site URL.
If you accidentally install WordPress in a subdirectory and want to transport it to the foundation listing, you are in the proper place. In this post, we will show you a way to get rid of /WordPress/ from your WordPress web page’s URL.
Why You See /WordPress/ in Your WordPress Site URL
WordPress is quite easy to install and in recent times, maximum WordPress web hosting provider offer short WordPress installers in their hosting control panel.
However, a few beginners who’re manually installing WordPress may accidentally install it in a subdirectory. Most regularly, this subdirectory is called WordPress.
This takes place primarily because customers come to be importing the WordPress folder they find inside the reliable WordPress.Org download.
Let’s check a way to get rid of /WordPress/ out of your web page’s URL.
Removing /WordPress/ from WordPress Site URL
If you have just installed WordPress and there may be no content on your website, then you can simply go ahead and begin over.
Simply delete the current set up, and follow the instructions for reinstalling WordPress.
If you’ve already added content on your website, then there are two clean ways to remove the /WordPress/ out of your site’s URL.
Method 1: Change WordPress Site Address
If you have got an established WordPress website, then this method is easier and quicker. The downside of this technique is that your media files such as photographs will anyway use /WordPress/ in the URL.
First, you need to login to your WordPress website’s admin area and visit Settings » General page.
You will see the ‘WordPress Address,’ and ‘Site Address’ fields, both have the same URL.
You want to change the Site Address option and factor for your root domain, eg. https://www.Example.Com and leave WordPress Address choice as it is.
Once you do that, click on Save Changes button to save your settings.
Next, you want to connect to your internet site the usage of an FTP client. Once you’re connected, visit the /WordPress/ listing and download the .htaccess and index.php home page files to your computer.
If you are unable to find the .htaccess file, then you definitely may need to compel your FTP purchaser to show hidden files. If you are using Filezilla, then you want to click on Server from the menu bar and select ‘Force Show Hidden Files’ option.
Once you have got downloaded each files for your Desktop, you need to open index.php home page report in a text editor like Notepad.
In this file you’ll find a line like this:
1. require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
This line masses the wp-blog-header.php home page document which is required to load your WordPress website online.
What you need to do now is enter the appropriate location of the file by way of replacing the current line with this one:
2. require( dirname( __FILE__ ) . ‘/WordPress/wp-blog-header.php’ );
Save your adjustments and upload both index.php and .htaccess documents from your computing device to the foundation of your domain using FTP. The root folder is the parent folder with the WordPress folder inside it generally called /www/ or /public_html/
That’s all. You can now visit your internet site the usage of the root domain, and the entirety will work fine. However, if you want to login on your WordPress admin, then you’ll nevertheless need to go to the wp-admin within the WordPress listing like this:
Method 2: Move WordPress to Root Directory
This technique is more comprehensive and will permanently move your WordPress site from the subdirectory to the basis folder of your website.
Step 1. Create a Duplicator Package
First, you need to install and activate the Duplicator plugin on your website.
Upon activation, you want to visit Duplicator » Settings page and click on the ‘Create New’ button.
This will launch the Duplicator wizard, with a view to create an installer package of your complete website. Click on the next button to continue.
Next, the plugin will run some scans. If everything seems OK, then you could click on the Build button.
Duplicator will now create a package and prompt you to download it along with the installer script. Go beforehand and download both files on your computer.
Step 2. Create a New Database for a Fresh WordPress Install
You can use the existing WordPress database. But it is best practice to create a new one so that your old database is safe and unchanged. This way you could revert back on your website without difficulty if something goes wrong.
Visit your web hosting account’s cPanel dashboard, scroll down to the ‘Databases’ section, and then click on at the ‘MySQL Databases’ icon.
After that, offer a name on your database and click at the ‘Create Database’ button.
Cpanel will now create a brand new database for you. After that, you want to scroll right down to the ‘MySQL Users’ section.
From here, you need to provide a username and password on your new database user and click on the ‘Create a user’ button.
Now you want to assign database permissions to the brand new user.
Scroll down to the ‘Add User to Database’ section. Pick the database user you made out of the dropdown menu next to the ‘User’ field, then choose the database, and click on the add button.
Your new database is now geared up for use for the clean WordPress installation.
Step 3. Run the Duplicator Wizard
Now, you have to add the Duplicator archive package and the installer file you downloaded in earlier to the root directory of your website.
This will be the directory containing the /WordPress/ folder.
After you have uploaded both files, open the installer script in a browser window. You will need to enter your web page’s root URL and then prefix it with /installer.php.
This will open the Duplicator installer wizard.
Check the terms and conditions field and then click on on the ‘Next’ button to keep.
Next, it’ll ask you to offer the database statistics. Enter the details for the database we created in advance in step 2.
After entering database records, click on the next button to hold.
Duplicator will now unpack your WordPress database backup from the archive into your new database.
Next, it’s going to ask you to update the site URL and Path. You don’t want to do something here because it will routinely locate new URL and path. However, if it doesn’t, then you can manually enter it right here.
Duplicator will now end the migration, and you will be capable of click on on the Admin login button to get access to your website on the brand new area.
Step 4. Set up Subdirectory to Root Folder Redirects
You’ve got moved your WordPress website from subdirectory to the root folder.
Now it’s time to set up redirects so that your customers and search engines like google and yahoo can locate your website new location.
First, you need to connect to your WordPress website online the use of an FTP client, after which delete the old/WordPress/ folder.
After that, switch to the admin area of your WordPress web page. Since you’ve got moved it to the root of your website your WordPress admin URL will be like this:
Now, you want to put in and activate the redirection plugin.
Upon activation, you want to go to Tools » Redirection page. The plugin will now display you a setup wizard. Simply click on at the continue setup, after that click finish the setup button.
Next, you need to replace to the ‘Redirects’ tab and add your new redirect.
First take a look at the ‘Regex’ checkbox at the nook of the primary field.
After that, For supply URL you’ll add https://example.Com/WordPress/.* and for Target URL you’ll add https://example.Com/$1.
Don’t overlook to replace example.Com along with your very own domain call. Click at the ‘Add Redirect’ button to keep your modifications.
From now on all customers accessing your website with /WordPress/ in the URL can be robotically redirected to correct posts with your new root URL.