Do you want to remove /wordpress/ from your WordPress site URL? It is appearing in your site URL because you have installed WordPress in /wordpress/ folder of the web server which is called sub-directory.
Many best website hosting provider allow you one click installer tool to properly installed WordPress. In this tutorial you will learn how to remove /wordpress/ from your WordPress site URL.
Why do you See /wordpress/ in Website URL?
While installing WordPress manually, you need to install the files inside the WordPress folder in root directory. Accidentally the WordPress core files installed along with the WordPress folder which cause your website URL to appears with /wordpress/.
How to Remove /wordpress/ from Website URL
If you have installed fresh WordPress without content then you can remove /wordpress/ by deleting all the installed files and reinstalling following this guide on how to install WordPress.
If you already have contains in your WordPress site then you can follow the instruction below to get rid of sub folder e.g. /wordpress/ from website URL.
Method-1: Change Site Address
This method is the easiest way to remove /wordpress/ from the website URL. However, you may still need to access your WordPress admin area using same URL e.g. www.yourblog.com/wordpress/wp-admin and the media files such as images will also remain in same site URL /wordpress/.
1. Change Site Address
Login to WordPress dashboard and click on Settings then General. In the WordPress address URL and Site Address URL you will see the same URL with /wordpress/. You need to remove /wordpress/ from Site Address URL and click on Save Changes button.
2. Download .htaccess & index.php File
You need to download .htacess and index.php file from /wordpress/ directory. You can do this by connecting to your web server using FTP client FileZilla. Once connected, in the root directory you will see /wordpress folder, double click the folder to open.
You will find index.php and .htaccess files, if you did not find .htaccess files in the folder then you need to unhide hidden files in the server going to server menu then click on Force showing hidden files.
After downloading both the files on your computer you need to edit index.php files using file editor such as notepad. You will see the line of code in the files which need to be replace.
Replace the line of code with the below line of code.
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
After replacing, you can save the file and upload both .htaccess and index.php files in root directory of your web server. Often root directory are named as /www or /public_html in web server.
You can load your website without /wordpress/ in the site URL. You still need to access WordPress dashboard with /wordpress/ in URL e.g. www.yourblog.com/wordpress/wp-admin
Method 2: Move the WordPress Folder to Root Directory
This method moves your WordPress site from the sub directory to root directory permanently. To do that, first you need to install duplicator plugin. You can see this guide if you do not know how to install WordPress plugins.
Install and activate Duplicator plugin.
After installation click on Duplicator then packages. You need to create new packages click on Create new button then click on next button.
The Plugin will scan your website, once completes you will see Good sign in green button. Select the Yes, Continue with the build process ! box then click on build button.
The plugin will start building the packages, once completes you will see the option to download the packages. Click on Installer button then Click on One-click Download links to download the package.
Keep the downloaded files on the desktop to upload to the web server.
Create a New Database
You need to create a new database for fresh WordPress installation. Go to Control panel of your hosting account then click on MYSQL Database Wizard under databases.
In the first step, type the name of the database then click on Next Step button.
Now, type the database username and password then click on Create User button.
In the last step you have to add user to database. Select on All privileges box then click on Next Step button. You have completed creating the database.
Upload Downloaded Package to the Web Server
You need to upload the package that you have download earlier. You need FTP client FileZilla to upload to the files to the web server. If you don’t know to use FTP client, you can refer to this guide on how to use FTP client.
Connect FTP client FileZilla to the web server then open root directory e.g. public_html in remote site section. From the Local site section navigate to the downloaded package files (e.g. in desktop) then right click on both the files and click on upload.
After uploading both the files you need to open installer.php in your web browser. You can open this file adding /installer.php after the root domain. For Example
You will see the duplicator installer wizard where you have to select the terms notices then click on Next button.
In the second step, enter the new database information and click on Test database, if everything all good then click on Next button.
You may see install configures pop up click on OK button.
In the next setup you need to update the blog URL and the path. It will automatically find the URL and Path, if not then you need to do it manually. click on Next button.
In the last step, duplicator provides you admin login button to access your WordPress dashboard in new location.
Redirect /wordpress/ to root directory
You are able to login admin panel from the root directory, e.g. https://example–blog.com/wp-admin. Before you redirect /wordpress/ folder to root directory you need to delete existing files in your website.
To do that you need to access your web server using FTP client e.g. FileZilla. Open root directory and delete the /wordpress/ folder that contain existing WordPress installation. You may like to see the detailed guide on how to use FTP to upload files.
After deletion, you have to redirect the existing WordPress installation URL to the root URL.
For Example: Exisiting URL: https://example--blog.com/wordpress Root URL: https://example--blog.com/
To redirect the URL, you need to install and activate Redirection plugin in your WordPress blog. If you do not know, you can see this guide on how to install WordPress plugins. Install and activate Redirection plugin.
After activation, Go to Tools then Redirection. You will ask to configure the plugins follow the few step then you will see the screen below.
In the source URL type the existing WordPress URL and in Target URL type the root domain then click on Add Redirect button.
Hopefully this guide on how to remove /wordpress/ from your WordPress site URL is helpful. You may also like to see 27 common WordPress errors and how to fix them. If you find this guide helpful, please share and follow us on facebook and twitter.