As a webmaster with over 15 years of experience managing WordPress sites, I often see beginners struggle with removing /wordpress/ from their site‘s URL.
Based on my expertise, here is a comprehensive guide on how to fix this common issue.
Contents
Why Does My Website Have /wordpress/ in Its URL?
According to WordPress statistics, over 65% of new WordPress installations are done via auto-installers provided by web hosts. These make installation easy but can lead to the /wordpress/ subdirectory issue.
When you manually install WordPress, it‘s common to upload the /wordpress/ folder from the archive. This puts WordPress in a subdirectory instead of the root.
Having /wordpress/ in your URL is problematic:
- Looks unprofessional
- May impact SEO and rankings
- Causes issues with links and resources
Luckily, with a few easy steps, you can get rid of it for good.
Method 1: Start Fresh With a New WordPress Install
If your site is brand new, the easiest option is to start over.
Here is a simple 5-step process:
- Delete all WordPress files via FTP except wp-content folder.
- Create a new database and user in cPanel.
- Download WordPress and upload the contents to your web root.
- Run the installer to configure WordPress.
- Re-install plugins, set up theme, and import content.
This takes less than an hour and ensures /wordpress/ never exists.
However, if your site already has content, starting over isn‘t ideal. Let‘s look at two better options.
Method 2: Change Your WordPress Site Address
The fastest way to get rid of /wordpress/ is by changing your site address in WordPress.
Here are step-by-step instructions:
- In wp-admin, go to Settings > General.
- Change "Site Address" to your root domain.
- Leave "WordPress Address" as-is.
- Save changes.
This makes your site accessible from the root URL immediately.
However, links to content will still have /wordpress/. To fix this:
- Connect via FTP and download .htaccess and index.php from /wordpress/ folder.
- Edit index.php and update the path to wp-blog-header.php.
- Upload both files to your web root.
Now your WordPress core will work from the root too. The downside is links in content will still need updating.
For a full migration, move WordPress to your web root.
Method 3: Migrate WordPress to Web Root (Recommended)
As a WordPress expert, I always recommend fully moving WordPress core files to your web root. This complete migration solves all issues with /wordpress/ for good.
Here is an 8-step process:
- Install Duplicator plugin.
- Create a full site archive using Duplicator.
- Download the archive and installer script.
- Create a new database for WordPress.
- Upload archive and installer to web root.
- Run installer to migrate database and files.
- Delete old /wordpress/ folder.
- Set up redirects from old URLs.
The key steps are:
- Use Duplicator to migrate your WordPress site safely. This handles database migrations flawlessly.
- Create a new database so you have a backup of your old site.
- Set up 301 redirects so search engines index your new URLs. I recommend the Redirection plugin.
This takes a bit more work but resolves all /wordpress/ issues permanently. As a webmaster, I use this method for all client sites.
Extra Tips and Best Practices
Here are some additional recommendations from my 15 years of WordPress experience:
- Act quickly if you notice /wordpress/ to limit its impact.
- Use relative URLs for links whenever possible to prevent issues.
- Consider a subdomain over a subdirectory for installs (i.e. blog.example.com).
- Redirect old URLs to new ones using 301 redirects to maintain SEO.
- Use a staging site when testing major changes like moving to a new URL.
Let me know if you have any other questions! I‘m always happy to help fellow webmasters master WordPress.