How to Remove /wordpress/ from your WordPress Site URL
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 tutorials 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.
We hope this guide is 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.