How to change a WordPress installed in the WP directory to the root directory?

 

When we perform a WordPress installation we can choose the directory in which it will be done, sometimes it runs in the default WP directory

If it is a new WordPress installation in which no change has been made in the default template, we suggest entering Softaculous app installer and select "List of Installations" in the upper right

Once we enter, we will see the existing WordPress installations and from there we can uninstall it.

To correctly perform a new installation in the root directory, we simply make sure that the field destined for the directory is empty (without WP)

 

If it is an installation in which you have made modifications and you do not want to start from scratch with a new template, we suggest the following steps:

  1. Access the cPanel of the corresponding account and click on the File Manager option
  2. Press the Configuration button (upper right corner) and make sure that the option "Show hidden files (dotfiles)" is checked. If not, check it and press the Save button
  3. Now you have to navigate to enter the directory where WordPress is installed. Once there, you have to select all the files and folders, right-click on the selected files and press the Move option. In the path, the destination directory should remain. In the case of being public_html, for example, it must remain «/ public_htm /«. Then press the Move file (s) button
  4. After the files are moved, we have to modify the database. We must go to the WordPress database from phpMyAdmin, press the table XXX_options (XXX can be any name, it is different in each installation). In the "option_value" of "home" and "siteurl" we must leave the correct URL for the site to be seen. For example, if it was "http://domain.com/wp" and we moved the site to public_html, now it should be "http://domain.com" in both fields
  5. In the site's .htaccess, make sure that the path to the index.php is correct. That is, if these lines of code are displayed:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /wp/

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /wp/index.php [L]

</IfModule>

We have to correct the third and penultimate line, so that it remains with the correct route, that is:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

 

Done!

You can contact our technicians in case of any other question.

  • Email, SSL
  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Related Articles

How to install WordPress and choose a web design?

Installing WordPress and start developing your website is more than simple, for this reason in...

How to install WordPress in a temporary URL?

Many times for one reason or another we need to use temporary URLs, either because we need to...

How to install Wordpress?

1. Access your cPanel account 2. Click on "Softaculous" 3. Click on "Install Wordpress" 4. Now...

How to optimize Wordpress?

WordPress is the most popular content platform for websites in the world. But one of WordPress...

How to increase the limit allowed by WordPress to upload files?

  Sometimes it is necessary to extend the limit that WordPress has to upload files.   This...