Skip to content

How to set up a new WordPress site on a live site without disturbing the existing one

This tip is brought to you by Carol Logan Newbill at 2fishweb.com. Step 6 is my favorite.

1.  Set up a new directory for the new WordPress site – domain.com/newsite (or something similar) and load the WordPress files into it.

2.  In the main www directory (domain.com), add a file called robots.txt that says this:

User-agent: *
Disallow: /newsite

That prevents robots from indexing anything inside the new directory.

3.  Develop your new site in domain.com/newsite just as you normally would.

4.  When you are ready to change it over and go live:

a.  Go to Settings -> General
- Leave the WordPress address URL as http://domain.com/newsite
- Change the site address URL to http://domain.com
- Save.

b.  FTP into the site.  Remove the old site files from the main directory (www).

c.  Copy newsite/index.php and newsite/.htaccess into the main directory (www).

d.  Open index.php in main directory.

- on the last line of code, change this         require(‘./wp-blog-header.php’);

to this               require(‘./newsite/wp-blog-header.php’);

- Save the file and upload.

e.  Remove the robots.txt file in the main directory, if you didn’t remove it before.  Change the Privacy settings inside WordPress, if you had those set to block search engines.

f.  In WordPress, go to Settings -> Permalinks and save.  You don’t need to change anything — just save it in order to refresh the .htaccess file without having to manually edit it.

5.  Now go to http://sitedomain.com and you should see your new WordPress site in all its glory (even though it’s actually tucked into sitedomain.com/newsite).  All links and URLS will point tositedomain.com.

6.  Open a frosty beverage of choice and send an invoice to the client.  Done!

Add Your Comment (Get a Gravatar)

Get a Gravatar! Your Name

*

Your email address will not be published. Required fields are marked *.

CommentLuv badge