Moving WordPress from Sub-Directory to Root Directory EASILY

()

Moving WordPress from Sub-Directory to Root Directory

Moving WordPress: Moving Your Site From a Subdirectory to the Root Directory

 

Reasons why Sub-Directory is used in website development

  1. Many clients want developer to show mockup website design or demo of the website ,so Sub-Directory or subdomain is mostly used by web developer .so if you are web developer you must have already installed WordPress website,HTML,PHP,ETC on Sub-Directory or subdomain
  2. Sub-Directory WordPress website doesnt interfere with LIVE site .so even if there are 1ooo errors on the Sub-Directory say  www.XYZ.com/wp ,still the LIVE site say  www.XYZ.com will be without any error
  3. Sub-Directory WordPress website helps you add user defined path instead of default WordPress login path ,so if default WordPress login path is say www.XYZ.com/wp-login.php which any HACKER can easily guess and can easily HACK your website .To avoid that you can always install WordPress website in a Sub-Directory say www.XYZ.com/xqsa .So your login path will give you extra security.

 

Follow below wordpress tutorial for Moving WordPress from Sub-Directory to Root Directory easily –

 

Suppose you have made Sub-Directory wp for developing a new WordPress website at say for example www.XYZ.com,so  the full path of  your new WordPress website along with Sub-Directory will be www.XYZ.com/wp  where wp is the name of Sub-Directory where we have installed new WordPress website.

 

Its very easy to move WordPress website installed at  www.XYZ.com/wp where wp is the name of Sub-Directory  to the root which is  say www.XYZ.com  here.

Must READ  How To Reinstall WordPress Core Files without losing content via FTP

Step 1-Turn off Permalinks

To start you will have to go to Settings > Permalinks  of this WordPress  www.XYZ.com/wp

Next choose Plain radio button to turn off Permalinks

Click the Save changes button and move on to the next steps

Below image example shows how to choose Plain radio button to turn off Permalinks  in https://localhost/ localhost environment

DEFAULT permalinks

Step 2-Change Site Address (URL) only

Next go to Settings > General, change the address of your  Site Address (URL)   but keep the address of WordPress address (URL) unchanged. For example,

By default it will be shown as below

 

 

After Changing above Site Address (URL) www.XYZ.com/wp to www.XYZ.com you will get below

 

Below image example shows how to change Site Address (URL)

Changing wordpress Site Address URL

 

Click the Save changes button and move on to the next steps

Step 3-Copying index.php,.htaccess Files to the root directory

Next using FTP or CPanel file manager, copy (don’t move) the following files from your WordPress sub directory i.e wp to the root directory:

Copying the Files

  • index.php
  • .htaccess, if you have one. If there isn’t an .htaccess file (and the fact that you’ve turned off pretty permalinks means you’re less likely to have one), don’t worry about creating one—just skip this step.

Step 4-Editing index.php Files

 require (‘./wp-blog-header.php)
And change above bold  text to below bold text
require (‘./subdirectoryname/wp-blog-header.php)
So if you’ve been developing your WordPress website here XYZ.com/wp, then just change the line to:
require (‘./wp/wp-blog-header.php)
as shown in below image
Editing index.php
Now Save the new index.php file .
This will complete our wordpress tutorial of Moving WordPress from Sub-Directory to Root Directory

 

Must READ  4 WordPress ECommerce Store Plugins for Starting Your eCommerce Store

VIDEO HELP for Moving WordPress from Sub-Directory to Root Directory

Let us know if you have doubts we will solve ASAP

 

How useful was this post?

Click on a star to rate it!

Admin

For paid sponsorship & partnership, email our board of admin at [email protected] , [email protected] . Regards. :)

Leave a Reply