Skip to Content

How to Remove WordPress from URL — There You Go!

How to Remove WordPress from URL — There You Go!

The only time WordPress needs to be in your URL is when you build your site on WordPress.com.

Installing WordPress on your own domain needs the installation files in your root directory.

When your install files are installed to a WordPress subdirectory, that’s when you get the /wordpress/ at the end of your URL.

There’s a few ways to go about removing WordPress from your URL. Each are covered below.

How to Remove WordPress from URL

You can remove the /wordpress/ from the URL by changing the site address URL, moving your WordPress folder to the root directory, or if you have a lot of files, you’ll be safer to backup and clone your site. If you are on wordpress.com, you can’t remove “WordPress” from your domain. 

 

Understanding the WordPress in URL Issue

The structure of domain names points browsers to folders and files to your webhosts server.

Folders for your main domain go into the root directory, which is usually the public_HTML folder.

Some hosting providers might label it the httpdocs folder or even www.

Subdirectory folders are those under your root directory.

When you have /wordpress/ in your URL, it’s caused by having your WordPress installation folders and files stored in a WordPress subdirectory, instead of the root directory.

In your file manager, clicking the + icon to expand the folders will show the subdirectories. WordPress will be there.

But you can’t just drag it into the root directory to remove the /wordpress/ from your URL.

There’s a few steps involved.

The Fastest Way to Remove /WordPress/ from Your URL

Delete the installation and start over. Granted, this is only applicable for new sites with absolutely nothing to lose, but it is the fastest.

Delete the installation, then start over, this time using one of the speedy installation wizards that most web hosts provide.

Depending on your host, it’ll either be the “QuickInstall” software, or the “Softaculous Apps Installer”.

Both are fast and install WordPress on your root directory.

If your web host doesn’t have a software installer, then you’ll need to upload your files manually.

For a new install, delete your current installation that’ll be in the WordPress subdirectory.

Download the latest version of WordPress at WordPress.org.

Log into your cPanel, click on File Manager, and make sure you’re in the Public_HTML directory (not in a WordPress subdirectory) then click upload and select the WordPress zip file you downloaded from WordPress.org.

The next quickest way that’s not quite as effective is to change the URL only.

Removing WordPress by Changing your Site URL

Log into your WP admin panel, go the “Settings” section that’s listed under the “General” menu on the left sidebar.

Here you can change your “Site Title”, “Tagline”, your “WordPress Address” and “Site Address”.

Don’t be fooled into thinking these are the same.

The “site address” is the public URL. You can delete the “/wordpress/” from here it and it’ll remove it from the browser address bar.

Do not change the WordPress Address URL!

That points browsers to your files and folders including the WP Admin folder so you will get logged out and won’t be able to log back in until you make changes in your database.

If you have made that mistake, don’t sweat it.

Here’s how to fix being force logged out of WordPress admin, unable to get back in…

  • Go to your cPanel, (yoursite.com/cpanel)
  • Click on “phpMyAdmin”
  • Click on the database you need to change (if you don’t know, find it in the wp-config file from file manager. That defines the database it’s connecting to)
  •  Click on the wp_options
  •  Edit the siteurl back to its original structure

Then you’ll can log back in.

This time, only change the “Site Address URL”.

The General Settings URL change can only be used to change the public website URL. It cannot change where your files are stored.

Once you change the site address, you then need to do a behind-the-scenes redirect. Until you do, your site will show a server 500 error.

Log into your cPanel, go to file manager and download copies of your .htaccess file and the index.php file from the WordPress subdirectory.

You’ll need a plain text editor like Notepad to make edits.

The only file to edit is the index.php file. The .htaccess just needs a copy uploaded to the root directory.

Open the index.php file and you’ll see a section nearer the end that reads…

require __DIR__ . ‘/wp-blog-header.php’;

or

(dirname(_FILE_).’/wp-blog-header.php’)

Before the forward slash is where to type wordpress so that it points browsers to the right folders to find the files to load.

Your file should now have either

(dirname(_FILE_).’wordpress/wp-blog-header.php’)

Or

require __DIR__ . ‘wordpress/wp-blog-header.php’;

Save changes then go back to file manager, go into your root directory (public_html) folder and upload both files – the .htaccess and the edited index.php file.

When you go back to your site now, it’ll load.

All you’re essentially doing is a redirect, but one that only browsers can follow.

To visitors, they won’t see any mention of WordPress in the browser address bar.

The last thing you need to do that makes sure the changes stick is to save your permalinks settings.

Go to your WordPress dashboard, click on “Settings”, click “Permalinks”, then select any ‘other’ permalink and save it.

Change it back to whatever you prefer.

The only important thing is that it’s saved with a different setting because that resets the permalink structure sitewide, ensuring /wordpress/ is completely removed from every URL.

You’ll still need to use the /wordpress/wp-admin URL to login though because none of your folders have been moved.

To remove /wordpress/ from all your URLS, (images and uploads too), you need to move everything over to the root directory.

How to Remove /WordPress/ by Moving the WP Subdirectory

How straightforward this is depends on the size of the site you’re moving.

Before you move anything, make a backup of everything.

If you’re moving an old site with hundreds of pages, and media uploads, you’ll probably be better with a premium migration plugin.

The reason being, when you move your folders, you need to change the URLs of your internal links, image files, PDF files and the likes.

For a small site that’s not had the WordPress in URL problem for long, you’ll be able to do what’s needed just in cPanel.

Use a plugin like Updraft Plus or Backup Buddy to make a backup of your site. Some are good at cloning everything, including your settings.

Once you have a backup, login to your WordPress admin panel.

This will still be at the ___.com/wordpress/wp-admin/ URL.

Go to General > Settings.

This time, DO change the “WordPress Address URL” and the “Site Address URL” by removing /wordpress/ from the end of both URL addresses.

Press save and you’ll automatically be logged out and shown an error 404 page.

You do have to break things before you can fix them.

To fix it, you need to move the WordPress folders from the subdirectory to the root directory.

Login to your cPanel, and click into the file manager.

From there, click into your public_html folder, or whichever the root directory is, navigate to your WordPress subfolder and double-click to open it.

Up top, you’ll see a link to “select all”.

Click that, then select “copy”, at which point you’ll be prompted to “enter the file path that you want to copy this file to”.

It’ll be pre-filled with “public_html/wordpress”. Remove the wordpress from that URL, then click “copy files”.

It’ll move all the selected folders and files up one level into the root directory.

Clicking “up one level” now should show you all the folders and files you just moved to the root directory.

But, you’ll also still have that WordPress subdirectory where there’s going to be duplicates.

You can delete that, but you’ll be far safer renaming it as “WordPress.old” or something similar.

The important thing is that all your WordPress files are in the root directory.

Once your files and folders for WordPress are in there, then the /wordpress/ will be removed from the URL.

Now, all there’s left to do is fix any broken links and change your image URLs.

Anything that’s being linked to on your site using the /wordpress/ in the URL, will no longer work because the files are now successfully moved.

 

WordPress.com users — Do this!

Now, if you don’t have a self-hosted WordPress, namely you are using wordpress.com as your host, then to get rid of the “WordPress” in your URL, you would need to switch to wordpress.org, which means that you would need to self-host your website.

Self-hosting a website doesn’t mean you need to have your very own server, it just means that you will need to find a good hosting provider, such as Siteground or Agathon, that actually takes care of your hosting.

Sounds frightening, right?

Well, it’s actually not. Hosting a WordPress website these days is actually super easy and cheap. Just spent a few bucks per month and you can get your website running on a decent blog host.

Also, installing WordPress is extremely easy, too, as most hosting providers literally provide 1-click installers for WordPress.

If you are serious about blogging and are planning to earn some money with your blog,  self-hosting your server is an absolute must. Better do it today than tomorrow.

Thank me later!

WordPress Media Library Not Loading
Previous
WordPress Media Library Not Loading — Here's Why
Cant' Install WordPress Plugins
Next
Can’t Install WordPress Plugins — 7 Possible Reasons