How to remove wordpress from url

New Page

How to remove /wordpress/ from your WordPress site URL

Anna Fitzgerald

Anna Fitzgerald

Updated: September 01, 2021

Published:10 de enero de 2020

All days, more than 500 eligible users create a WordPress site. One of the reasons for the popularity of WordPress is its ease of configuration. In fact, most hosting companies today offer one-click software installation.

Site%20propriétaire%20suppression%20wordpress%20de%20leur%20sites%20URL

However, there are times when you will need to install WordPress manually. Let’s say, for example, that you set up a site with a hosting company but forget to check the option to install WordPress. You will have an empty site and you will need to install the software manually.

While it’s an easy process, some beginners may accidentally install WordPress in their own directory named “WordPress” instead of the root directory. Sometimes, the URL will look like https://yoursitename.com/wordpress/. This can confuse your readers and make your site look less professional.

In this post, we will walk through the steps to remove /wordpress/ from your URL so you can avoid these pitfalls. Let’s dive.

Grow your business with HubSpot’s tools for WordPress websites

How to remove /wordpress/ from the URL of your site

Hay tres formas of eliminating /wordpress/ from his site URL. If your site is blank, you can simply uninstall the WordPress archive in its subdirectory, download the software, and protect it in the raíz directory. If su sitio ya tiene contenido, entonces tiene dos opciones. Puede cambiar the direction of the site in the WordPress panel. O puede uses un complemento para mover su site de WordPress del subdirectorio al directorio raíz.

If this is the address of your site, /wordpress/ is removed from your URL, but you are not actually moving your site from the subdirectory to the root directory. As a result, the URLs of the media files on your site will still include the subdomain number. To move your WordPress site to the root directory, you can use a plugin. Cette méthode requires plus de temps et d’espacement, but guarantees that no URL on your site will show /wordpress/.

We’ll take a closer look at each method below.

Remove /wordpress/ from a blank site URL

Let’s say you save your WordPress file dans le sous-répertoire et realize your mistake right away. Your site is brand new, with no content or settings configured. In that case, you’re in luck.

All you need to do is log in to your hosting account’s control panel and open File Manager. You can find it in the Files section.

El Administrador de archivos se encuentra en la sección Archivos de su panel de control

Fuente

On the navigation menu on the left side of your screen, click on the public_html tab. Note that, depending on your hosting provider, this folder may also be named www, htdocs or httpdocs.

La carpeta public_html se encuentra en el menú de navegación izquierdo de su Administrador de archivos

Fuente

Locate and open the “/wordpress” subfolder. Inside, you should see a .zip file containing the WordPress installation. Right click to remove it.

S’il n’y a pas de tapis, go une configuration. A window should appear with the “Préférences” label. Check the box labeled “Show hidden files.” You should now be able to see the folder and delete it.

Preferences box showing the checkbox labelled "Show Hidden Files"

Fuente

Descarga WordPress nuevamente y guarda el archivo .zip en tu computadora. Navegue de regreso a su carpeta public_html y cargue el archivo .zip de WordPress allí.

Click on the public_html folder and then click upload to move files to the root directory of your site

Fuente

¡Buen trabajo! WordPress ahora está instalado en su directorio raíz.

Removing /wordpress/ from URL of a Site with Content

If you’ve already added content to your site or configured its settings, then you won’t want to delete it and start over. In that case, you can either change your site address or move your site to the root directory to remove /wordpress/ from your site’s URL.

Let’s start with the easier method: changing your site address. We’ll then cover how to move your site to the root directory, which is the only way to remove the subdomain name from all URLs on your site, including those of images.

Change Your Site Address

To start, log in to your WordPress admin dashboard and go to Settings. Click General.

Here, you’ll see two URL fields — one labeled WordPress Address and another labeled Site Address — that both include /wordpress/.

Go ahead and delete “/wordpress/” from the Site Address field, but keep it in the WordPress Address field. When you’re done, scroll to the bottom of the page and save your changes.

User deleting /wordpress/ from site address but leaving it in wordpress address in general settings of dashboard

Source

At this point, if you try to type either URL into a browser, you’ll be presented with an error message that says your site doesn’t exist. Don’t worry — that’s supposed to happen.

To ensure this error message is resolved, you’ll need to make copies of your index.php and .htaccess files. To do so, log in to your control panel and open the File Manager under the Files section.

In the navigation menu on the lefthand side of your screen, click on the public_html folder. Open the folder labeled “wordpress.”

WordPress folder containing the .htaccess and index.php files in the root directory

Source

Locate the .htaccess and index.php files inside and download them to your desktop.

To make changes to the index.php file, you’ll need to use a text editor like Notepad.

Open the file in the text editor and look for the line that reads: require(dirname(_FILE_).’/wp-blog-header.php’)

Replace it with the following line of code: require(dirname(_FILE_).’/wordpress/wp-blog-header.php’)

Now when a visitor types in your site’s URL without /wordpress/ into a web browser, this snippet of code will tell the browser that the data it needs to load the page is located in the “/wordpress” sub folder.

Save the index.php file and upload it, along with the copy of the .htaccess file you downloaded to your computer, in the public_html folder.

Note that you didn’t need to make any edits to the .htaccess file, you just needed to copy it into the root directory. Since the .htaccess file controls access to your site, having a copy in your root directory will allow web browsers to retrieve data from the WordPress files in the subdirectory and display them to visitors.

If the contents of your public_html folder now look something like this, then bravo! Visitors will now be able to access your site without seeing /wordpress/ in its URL.

Root directory containing a wordpress installation and copies of the .htaccess and index.php files

Source

To ensure that all your links are working correctly, you have to take one last step. In your WordPress dashboard, navigate to Settings > Permalinks. Click on any other setting and save your changes, then change it back to your preferred setting. This will reset your site’s permalink structure so that /wordpress/ is removed from links on your site.

Please note, however, that your images and other media files will still use /wordpress/ in their URLs. To avoid this, you can use the method below.

Move Your Site from Subdirectory to Root Directory

Following the steps above will remove /wordpress/ from your URLs, but leave your WordPress files installed in the subdirectory. If you’d like to move them to the root directory in order to ensure /wordpress/ is removed from all links on your site, including images, then you can use a plugin. Let’s walk through the steps below.

Step 1: Create a Duplicator Package

First, you’ll need to install the Duplicator plugin on your WordPress site. On the lefthand side of your screen, click Duplicator > Settings. Now click the Create New button to launch the Duplicator wizard. This wizard will bundle all your site’s plugins, themes, content, and WordPress files into a .zip file called a package.

Create new Duplicator package directly in WordPress dashboard

Source

To start, the plugin will run a few scans to check that your server is healthy and the size of your files and database is possible to bundle. If the scan does uncover any warning signs, as shown below, then you can learn more by clicking on the linked text. For example, you may delete a few large files to reduce the overall size of your package. Or can simply proceed with the build process by clicking the Build button.

Results of a scan by the Duplicator wizard

Source

After you click the Build button, you’ll see a message that the package has been completed. Click the One-Click Download link to download both the package and the installer script.

pop-up message showing that Duplicator package is complete and ready for one-click download

Source

Now you can upload both the package and installer script to the root directory of your website. To do so, log in to the control panel of your hosting account and open the File Manager. In the navigation menu on the lefthand side of your screen, select the public_html folder and click the Upload button.

Click on the public_html folder and then click upload to move files to the root directory of your site

Source

You’ll then be prompted to select the files you want to upload. You’re looking for the installer.php file and another ending with .zip.

Root directory containing the Duplicator package and installer script

Source

Step 2: Create a New Database

You now have the option of creating a new database. If you’d rather use the existing WordPress database you have, you can skip to the next step. If you’d like to keep the existing database as a backup, then follow the steps below.

Log in to the control panel of your hosting account and click on the MySQL Databases icon. You can find it under the Databases section.

MySQL databases icon under the Databases section of a control panel

Source

You’ll be prompted to create a name for your new database. You can then click the Create Database button.

Now scroll down to the MySQL Users section. Under “Add New User,” enter a username and password. Click Create User.

Under “Add User to Database,” select the new user and the new database from the drop-down menus and click Add.

MYSQL Users section with "Add New User" section filled in with username and password

Source

Step 3: Run the Installer Script

Now that your database is ready, you can open the installer script in a web browser. To do so, type your website’s root URL into a browser tab, adding “/installer.php” at the end. It will look something like: https://yoursitename.com/installer.php.

This will open the Duplicator installer wizard.

You’ll need to check the box that says “I have read and accept all terms & notices” and click Next.

The Duplicator installer wizard prompts user to check box that says “I have read and accept all terms & notices”

Source

In the next step, you’ll be asked to fill in the information of the database you just created (or your existing database, if you chose to skip the previous step). Click the Next button to continue.

To complete the migration, you will have to update the site URL and path, which in most cases is detected automatically.

On the next screen, it will ask you to update some data, including the site URL and path of your duplicated site. This information will likely be filled in automatically so you’ll just need to verify it.

Another step in Duplicator installer wizard prompts user to verify data

Source

On the next screen, you can finalize the install by clicking the Admin Login button.

Final step of duplicator installer wizard prompts user to login to WordPress dashboard

Source

Step 4: Set Up Redirects from Subdirectory to Root Directory

You have now successfully moved your site from the subdirectory to the root directory. There’s just one more step to go.

Vous devez configurer des redirections afin que les utilisateurs et les moteurs de recherche puissent trouver votre site à son nouvel emplacement. Vous pouvez le faire en ajoutant du code au fichier .htaccess dans votre sous-répertoire.

Commencez par vous connecter au panneau de contrôle de votre compte d’hébergement. Ouvrez le gestionnaire de fichiers et cliquez sur le dossier public_html dans le menu de navigation sur le côté gauche de votre écran. Localisez et ouvrez le sous-dossier « /wordpress ».

Dans ce sous-dossier, cliquez avec le bouton droit sur le fichier .htaccess pour le modifier. Supprimez tout son contenu existant et remplacez-le par le code suivant :

RewriteEngine On RewriteCond %{HTTP_HOST} ^mydomain.com/subdirectory$ [OU] RewriteCond %{HTTP_HOST} ^www.mydomain.com/subdirectory$ RewriteRule (.*)$ http://www.mydomain.com/$1 [R =301,L]

Be sure to replace mydomain.com with your actual website name and /subdirectory with /wordpress.

Save your changes and congratulate yourself. You have successfully moved your site from the subdirectory to the root directory.

Changing your Site’s URL

No matter how old your site is or how much content it has, you can follow one of the methods above to remove /wordpress/ from your site’s URL. While these methods may be time-intensive, removing the subdirectory name from your URL will avoid confusing your readers or appearing unprofessional. This can help strengthen the very first touchpoint that visitors have with your brand.

Use HubSpot tools on your WordPress website and connect the two platforms without dealing with code. Click here to learn more.

Topics: WordPress Website

¡No olvides compartir esta publicación!

How to Remove “wordpress” From Your Site URL

By Kaumil Patel / WordPress Guides

Share via:

  • Facebook
  • Twitter
  • LinkedIn

Do you have a website URL that shows “wordpress” as part of the domain? This is somewhat common. It happens when WordPress is accidentally installed as a subdomain or in a separate folder as opposed to the root directory. For instance, a website could look like “https://www.ggexample.com/wordpress/.”

Instead of reinstalling WordPress altogether, you can easily change how the URL appears in web browsers.

Today in this tutorial, I’m going to show you how to remove the “wordpress” from your domain name. Although it’s not all that difficult, you will have to make a couple of minor changes to the .htaccess and index.php file of your site.

Change the Site Address in WordPress

Before you continue, I strongly urge you to create a backup copy of your site. In the event something goes wrong, you can easily restore your data without causing further problems.

The first thing you’ll need to do is change the “Site Address” in your WordPress admin dashboard.

Go to the Settings area in the WordPress dashboard.

WordPress Settings WordPress Settings

Remove the “/wordpress” portion of the Site Address URL.

Remove WordPress URL Remove WordPress URL

Scroll down and click the “Save Changes” button.

SaveChanges-2 Save Changes

Download index.php and .htaccess

Next, you’ll need to copy the index.php and .htaccess files from the “[your domain]/wordpress” folder from your website.

You have a couple of ways to do this. A lot of people prefer using FTP programs like FileZilla to connect to the web host and download the file. You can also use cPanel’s File Manager to access your website’s directory from a web browser.

For this tutorial, I’m going to use cPanel only because it’s quicker for this instance.

Go to the root folder for your domain. It may be empty except for a folder labeled, “wordpress.” You can access this from the “public_html” directory in your web host.

Open the “wordpress” folder.

WordPress Folder WordPress Folder

You may have to enable hidden files to see .htaccess. If you’re using File Manager, you can do this by clicking the Settings button and choosing “Show Hidden Files.”

ShowHiddenFiles01 Show Hidden Files

A similar option is available in FileZilla.

Download the .htaccess and index.php files to your computer.

Download Files Download Files

Although you won’t make edits to the .htaccess file in this tutorial, you’ll need it copied into the root directory. This is because .htaccess is used to control how people and search engines access content. Since you’re removing WordPress from the URL, you’ll need it in the root folder.

I suggest saving the files to your desktop. It makes it easier to find them in the next step. If you don’t have the option to choose where files are saved, look in your “Downloads” folder of your computer.

Editing the index.php File

To make changes in the index.php file, you’ll need a text editor of some kind. For PC users, you can open the file with something like Notepad.

Look for this line in the index.php file:[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );[/ht_message]

Replace the line with this snippet of code:[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );[/ht_message]

Replace Code Replace Code

This line tells a visitor’s web browser the actual data it needs is located in the “/wordpress” sub folder. It acts almost like a redirect by pulling information from the WordPress folder without users realizing it.

Once you’ve replaced the code, save the index.php file.

Uploading index.php and .htaccess

Upload the index.php and .htaccess files from your computer to the root directory of your website. DO NOT upload them back into the “/wordpress” sub folder.

Upload Index Upload Index

Now with the files in the root folder, your website will look something like “https://www.ggexample.com” to visitors.

However, you will still need to use the “/wordpress/wp-admin” URL to access the admin area of WordPress.

Can you just reinstall WordPress into the root directory?

While you could install WordPress in the near-empty root folder, it’s far more work. This is especially true if you have a database full of content, settings and modifications. If it’s a new install, then you won’t lose a lot of data and time.

If you decide to reinstall, it’s probably easier to copy WordPress from the sub folder to the root using cloning or copying plugins. Many of these will easily transfer all data and files.

Removing WordPress from the Domain Name

Changing the primary domain in WordPress helps clean up the website. At a glance, people can identify and easily access your site without the “wordpress” folder being involved. This is but a simple solution to give the website a nice appearance.

It’s also a time-saver instead of trying to move a website from one folder to another, which may have a lot of data tied to it.

How often have you made coding changes to customize your WordPress site? Which is your favorite way to access files from the web host?

Share via:

  • Facebook
  • Twitter
  • LinkedIn

How to Get Rid of /wordpress/ From your WordPress Site URL

Last updated on March 18th, 2019 by Editorial Staff | Reader DisclosureDisclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Shares 265 Share Tweet Share Facebook Messenger WhatsApp Email

Are you trying to remove /wordpress/ from your website’s URL? Sometimes beginners end up installing WordPress in a subdirectory, which causes /wordpress/ to appear in their website URL.

If you accidentally installed WordPress in a subdirectory and want to move it to the root directory, then you’re in the right place. In this article, we will show you how to get rid of /wordpress/ from your WordPress site’s URL.

Removing /wordpress/ from your WordPress site url Removing /wordpress/ from your WordPress site url

Note: The method shown in this tutorial works for other subdirectories as well.

Why You See /wordpress/ in Your WordPress Site URL

WordPress is quite easy to install and nowadays most WordPress hosting companies offer quick WordPress installers in thier hosting control panel.

However, some beginners who are manually installing WordPress may end up accidentally installing it in a subdirectory. Most often this subdirectory is named wordpress.

This happens primarily because users end up uploading the wordpress folder they find inside the official WordPress.org download.

Let’s take a look at how to easily fix this and get rid of /wordpress/ from your site’s URL.

Removing /wordpress/ from WordPress Site URL

If you have just installed WordPress and there is no content on your website, then you can just go ahead and start over.

Simply delete the current installation, and follow the instructions in our WordPress installation tutorial to properly reinstall WordPress.

If you have already added content to your website, then there are two easy ways to remove the /wordpress/ from your site’s URL.

Method 1: Change WordPress Site Address

If you have an established WordPress site, then this method is easier and quicker. The downside of this method is that your media files such as images will still use /wordpress/ in the URL.

First, you need to login to your WordPress site’s admin area and go to Settings » General page.

You will notice the ‘WordPress Address’ and ‘Site Address’ fields and both will have the same URL.

You need to change the Site Address option and point to your root domain, e.g. http://www.example.com and leave WordPress Address option as it is.

Once you do that, click on Save Changes button to store your settings.

Change WordPress site address Change WordPress site address

Next, you need to connect to your website using an FTP client. Once you are connected, go to the /wordpress/ directory and download the .htaccess and index.php files to your computer.

If you are unable to locate the .htaccess file, then you may need to force your FTP client to show hidden files. If you are using Filezilla, then you need to click on Server from the menu bar and select ‘Force Showing Hidden Files’ option.

Muestra archivos ocultos en tu cliente FTP Show hidden files in your FTP client

Once you have downloaded both files to your Desktop, you need to open index.php file in a text editor like Notepad. In this file you will find a line like this:

1

require ( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );

This line loads the wp-blog-header.php file which is required to load your WordPress site.

What you need to do now is enter the correct location of the file by replacing the existing line with this one:

1

require ( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );

Save your changes and upload both index.php and .htaccess files from your desktop to the root of your domain using FTP. The root folder is the parent folder with the wordpress folder inside it usually called /www/ or /public_html/

Directorio raíz con una carpeta de WordPress separada dentro Root directory with a separate WordPress folder inside it

That’s all. You can now visit your website using the root domain, and everything will work fine. However, if you need to login to your WordPress admin, then you will still need to go to the wp-admin inside the wordpress directory like this:

http://www.example.com/wordpress/wp-admin

Method 2: Move WordPress to Root Directory

This method is more comprehensive and will permanently move your WordPress site from the subdirectory to the root folder of your website.

Step 1. Create a Duplicator Package

First, you need to install and activate the Duplicator plugin on your website. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Duplicator » Settings page and click on the ‘Create New’ button.

Crear nuevo paquete duplicador Create new duplicator package

This will launch the Duplicator wizard, which will create an installer package of your complete website. Click on the next button to continue.

Next, the plugin will run some scans. If everything looks OK, then you can click on the Build button.

Construir paquete duplicador Build duplicator package

Duplicator will now create a package and prompt you to download it along with the installer script. Go ahead and download both files to your computer.

Descargar paquete duplicador Download duplicator package

Step 2. Create a New Database for a Fresh WordPress Install

You can use the existing WordPress database, but it is better to create a new one so that your old database is safe and unchanged. This way you could revert back to your site without much fuss if something goes wrong.

Visit your hosting account’s cPanel dashboard, scroll down to the ‘Databases’ section, and then click on the ‘MySQL Databases’ icon.

Base de datos cPanel Database cPanel

After that simply provide a name for your database and click on the ‘Create Database’ button.

Crear base de datos Create database

Cpanel will now create a new database for you. After that, you need to scroll down to the ‘MySQL Users’ section.

From here you need to provide a username and password for your new database user and click on the ‘Create a user’ button.

Crear usuario MySQL Create MySQL user

Now you need to assign database permissions to the new user.

Scroll down to the ‘Add User to Database’ section. Simply select the database user you created from the dropdown menu next to the ‘User’ field, then select the database, and click on the add button.

Agregar usuario a la base de datos Add user to database

Your new database is now ready to be used for the fresh WordPress installation.

Step 3. Run the Duplicator Wizard

Now, you need to upload the Duplicator archive package and the installer file you downloaded earlier to the root directory of your website.

This will be the directory containing the /wordpress/ folder.

Cargue archivos Duplicator en la carpeta raíz de su sitio web Upload Duplicator files to the root folder of your website

After you have uploaded both files, open the installer script in a browser window. You will need to enter your site’s root URL and then prefix it with /installer.php.

https://example.com/installer.php

This will open the Duplicator installer wizard.

Asistente para duplicar Duplicator wizard

Check the terms and conditions box and then click on the ‘Next’ button to continue.

Next, it will ask you to provide the database information. Enter the information for the database we created earlier in step 2.

Conecta tu base de datos Connect your database

After entering database information, click on the next button to continue.

Duplicator will now unpack your WordPress database backup from the archive into your new database.

A continuación, le pedirá que actualice la URL y la ruta del sitio. No necesita hacer nada aquí, ya que detectará automáticamente la nueva URL y ruta. Sin embargo, si no es así, puede ingresarlo manualmente aquí.

Nueva configuración del sitio New site settings

Duplicator ahora finalizará la migración y podrá hacer clic en el botón de inicio de sesión de administrador para acceder a su sitio web en la nueva ubicación.

Migración finalizada Migration finished

Paso 4. Configure el subdirectorio para las redirecciones de la carpeta raíz

Felicidades, ha movido su sitio de WordPress del subdirectorio a la carpeta raíz.

Now it’s time to set up redirects, so your users and search engines can find the new location of your website.

First, you need to connect to your WordPress site using an FTP client and then delete the old /wordpress/ folder.

Eliminar el antiguo subdirectorio de wordpress Delete old wordpress subdirectory

After that, change to the WordPress site administration area. Start the movie on the web of your site, on the WordPress admin URL as follows:

https://ejemplo.com/wp-admin

Now, you need to install and activate the redirect plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Tools » Redirection page . The plugin will now show you a configuration wizard. Simply click on continue with the configuration and then on the button finish the configuration.

Redirect configuration Redirect configuration

Next, you need to switch to the ‘Redirects’ tab and add your new redirect.

First check the ‘Regex’ checkbox in the corner of the first field.

After that, for aggregate origin URL https://example.com/wordpress/.*y for aggregate destination URL https://example.com/$1.

Redirect subdirectory to root folder Redirect subdirectory to root folder

Don’t forget to replace example.com with your own domain name. Click the ‘Add Redirect’ button to save your changes.

From one hour, all users who access a website with /wordpress/ in the URL will be automatically redirected to the correct publications with the new URL raíz.

C’est tout. We hope this article helped you learn how to get rid of /wordpress/ from your WordPress site URL. You can also consult our complete guide to the most common WordPress errors and how to fix them.

If you like this article, submit to a new YouTube channel for WordPress video tutorials. Also puede encontrarnos on Twitter and Facebook .

Shares 265 Share Tweet Share Facebook Messenger WhatsApp Email

Google Google translator

Google Google Translate


Video How to remove wordpress from url

Related Posts

How to add seo keywords in wordpress

Contents1 Cómo agregar palabras clave de SEO en WordPress (aumentar el CTR y las clasificaciones)1.1 Post Title1.2 Headline1.3 Header Tags1.4 Introduction and Conclusion1.5 Body Copy1.6 URL1.7 Meta…

How to embed google calendar into wordpress

Contents1 How to Add a Google Calendar in WordPress (Step by Step)2 Add a Google calendar to your website3 calendario de Google3.1 Versatile plans and pricing4 Video…

How to change the logo in wordpress

Contents1 How to Add a Custom Logo to Your Site Header2 Site Logo2.1 Planes y precios versátiles3 Add, remove or edit a custom logo4 Video How to…

How to add a popup on wordpress

Contents1 Easily create a WordPress emergent form (2 forms)1.1 ¿Por qué usar un formulario emergente de WordPress?1.2 Método #1: Crear un formulario emergente con OptinMonster + WPForms1.3…

How to roll back wordpress version

Contents1 How to Revert WordPress: Undo WordPress Updates (Easy Way)2 How to Downgrade WordPress & Roll Back to a Previous Version2.1 1. A WordPress update included significant changes…

How to rollback wordpress version

Contents1 How to Downgrade WordPress and Revert to an Older Version1.1 1. A WordPress update included significant changes that are not compatible with your theme or plugins1.2…