Moving your Wordpress from a subfolder to the root directory?

Ben Newman

Member
Registered
Joined
Nov 7, 2016
Messages
21
Points
1
I like creating and testing a new version of my site in a subfolder and make it pirate with search engine before publishing it. So that it does not affect their main domain. Once completed, I will want to migrate the new site over to the root directory for the domain. This is very effective to testing sites and new functions with WordPress. I want to know all the ways to move my Wordpress rom a subfolder to the root directory after I finished the test.
 

tlhIngan

Member
Registered
Joined
Jul 12, 2016
Messages
49
Points
8
I will explain the simple steps to perform the migration of a subfolder located on the address example.com/subfolder to the new location such as example.com

The first thing you have to make a backup of all files and database are part of you site, so that if any problems occur, we can return to the starting point.

Once done your backup, you access the administration of your WordPress and within the "Settings" menu click on the "General" option. In this screen we will have to make two changes:

migrate-wordpress-site.png

WordPress address (URL): Here you indicate the new URL where files will be located as part of the application, in your case we change to

Code:
http://www.example.com
Site address (URL): In this box is noted as in the previous case, that is

Code:
http://www.example.com
Once made these changes, click on the "Save Changes" at the bottom of that page.

If You had forgotten to make these changes before the migration, we can not access the administration to realize them. However it can be solved by accessing the database, using a tool in your hosting panel like phpMyAdmin or similar one.

phpmyadmin-cpanel.png

Once we are connected to the database, we have to go to the "wp_options" is the table that stores all options that can be configured from the administrator.

wp-option-table.png

In this table you must find the "siteurl" and "home" options, and edit them to your new location.

site-wp-option-table.png

After this step, the next you will move files in "your subfolder" to the root directory. This process is done by some FTP program such as Filezilla, CuteFTP or another FPT client that you can find in the network.

Once this process is completed, we will be able to re-access the administration of your blog through the url "http://www.example.com/wp-admin", but we will not be able to access the public part since we have changed the folder where it was installed WordPress.
To make it work you need to change the permalink links, an action that will change the file .htaccess which is part of the installation of the tool.

To make this change, you enter into the administration and go to the "permanent links" that is in "Settings" section. Once inside this section, click on the button "Save Changes" to WordPress update your .htaccess file.

If you don't want to update the settings in wp-admin, you can directly copy codes into .htaccess file located in your root folder as follows

htacess-codes-wordpress.png

Once you have verified everything and they work correctly, it is recommended to delete the subfolder where you had before installing your blog, to avoid confusion in the future.

This same process can apply to migrate your WordPress installation from one directory to another completely different.
 
Older Threads
Latest Threads
Recommended Threads
Replies
3
Views
3,147
Replies
4
Views
3,563
Replies
6
Views
2,582
Similar Threads
Replies
4
Views
2,741
Replies
10
Views
3,101
Replies
6
Views
3,423
Replies
2
Views
3,749

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top