How To Build a WordPress Test Site

construction
It’s easier than you think to build a WordPress demo site or as others call it, a WordPress test site.

Today’s WordPress tutorial will demonstrate the steps necessary to create a new OR convert an existing standard WordPress website into a network of sites by using the multi-site feature. By the end of this tutorial you will have created a WordPress multi-site network that will allow you to run a collection of websites that all share the same WordPress installation.

The reasons to build a WordPress test site can vary. Several reasons include:

  1. WordPress design agencies might want to build a client’s website on a public accessible server
  2. WordPress theme builders might want to showcase their premium WordPress themes on a sub-domain using sub-directories
  3. WordPress plugin builders might be testing a new piece of functionality on their latest version
  4. the reasons go on…

For this particular WordPress tutorial we’ll be providing information on how to build a WordPress test site on a sub-domain using sub-directories. Our wp tutorial will cover the steps necessary to build your test website using URLs as demonstrated below.

  • http://demo.wpsyntax.com
  • http://demo.wpsyntax.com/minimum
  • http://demo.wpsyntax.com/theme2
  • http://demo.wpsyntax.com/theme3

OK, lets get started!

Minimum Requirements

WordPress 3.0 or higher is required.

If you are converting an existing WordPress install then please disable all plugins and backup your database and files.

Step 1: Modify WP-Config.php

FTP to your website (for us it’s demo.wpsyntax.com) and make a backup copy of wp-config.php in case something goes wrong. We usually make a copy and name the backups wp-config.php.bkup. Feel free to do the same or use your own naming convention.

Next, download wp-config.php found in the root of your WordPress install. Open the file in your favorite source code editor and look for the line /* That’s all, stop editing! Happy blogging. */ and add an empty line just before it. Place this code into your file:

define('WP_ALLOW_MULTISITE', true);

Your file should look like the image below.
wordpress test site image 1

The line of code you added into wp-config.php instructs WordPress to enable the Network Administration panel and prep the network install process.

Now, save the file and upload it back to your website.

Step 2: Enable & Configure WordPress Networks

Go to the Admin dashboard and click on Tools -> Network Setup
wordpress test site 2

The next screen you see needs to be filled in carefully. As I mentioned at the beginning of this tutorial, we’re going to be creating a WordPress test site on a sub-domain using sub-directories.

Take a look at the image below to see that I selected “Sub-directories” and entered values for the “Network Title” and “Admin E-mail Address.”

wordpress-test-site-3

Once you have everything filled out, click on the “install” button.

Step 3: Enabling the Network

At this point WordPress works some magic under the covers and then presents you with a screen containing instructions informing you that the next steps involve editing your .htaccess file and your wp-config.php file once again. As suggested by WordPress, it’s always best to make a backup of your files before making the edits. The image below details the next steps to enabling the network on WordPress.

wordpress test site 4

To be clear, the code you add to your wp-config.php file will be placed immediately following the one line of code you entered in step 1 of this process.

Once you made your changes to .htaccess and wp-config.php you will need to save the files and upload them back to your web server. you will need to log into WordPress once again. At this point you should now see that you have successfully created a WordPress test site that’s perfect for theme developers showcasing their themes or for developers to build test sites for clients.

If you did everything right, your dashboard should now include “My Sites” in the two areas seen below in the image below.
wordpress my sites

Written by Rick R. Duncan

Rick is a Richmond WordPress Developer and cyclist that enjoys pedaling WordPress, SEO and Internet Marketing Tips on Twitter, Google+ and here on WPSyntax.com.

Comments

  1. Hi,

    Your blog provides very very good info as I’m a Genesis fan (Minimum child theme).
    Thank you for this short and simple tutorial.
    Just 1 suggestion: in “Step3″, maybe you should indicate to upload again .htaccess and wp-config.php files after modification…

    Good bye
    Jeremy

    • Hey Jeremy,

      Good point. I have updated Step 3 to be clear that you will need to save and upload the files to your web server just like Step 1.

      -rick

  2. So. I followed the steps above with the only exception that my wp install is on the sub-dir: “site.com/wp”. Everything seems to have worked as expected…but now I’m not sure what to do from here. After you enable the network, how do I go about actually creating a test site and directory? I’m trying to do this as “site.com/wp/t”. Am I just missing a simple step?
    SUPER simple tutorial–Thanks!

    • haha, fixed. wp-config.php did not save correctly before I uploaded it. I would suggest clarifying that users should see the “Sites” button next to the WordPress Icon on the admin bar, after steps have been completed, so they did everything correctly. Just in case another idiot like myself comes across this.

      • Hey Kris,

        I’m glad you get it straightened out. I’ve updated the tutorial to include an image of what users should see if everything is working properly. Hopefully it will help the next person that wants to create a WordPress test site.

  3. Hi there,
    I updated the wp-config.php file to include the line of code, saved it and uploaded it to my site. I then went to enable and compress the wordpress network and the network setup option wasn’t there under “Tools.” I realized I probably needed to refresh to see the option and I get a server error. Can’t view the site or log in to WordPress. I removed the line of code and re-uploaded the wp-config.php file but still have the server error. I realize this is a simple line of code that shouldn’t cause this issue but all was good until I changed the config file to add that line of code.

    Any help would be appreciated.

    • Rick R. Duncan says:

      Hi Sandy,

      I’m not following your comment where you say ‘enable and compress’ the WordPress network. No where in my tutorial do I use that terminology.

      With that said, usually when you get the dreaded WordPress White Screen of Death after editing the config file it’s because of a space at the end of your file. Please place your cursor at the very end of the file and remove all spaces up until the last closing Php tag. Please give that a try and let me know if that will at least get you back to a working website.

      Thanks,
      -rd

      • Sorry that was a late night drowsy post – was supposed to say “enable and configure WP Networks. So I worked with Bluehost and the issue was I was editing the php file locally and then loading it to the site via Filezilla rather than editing from file manager. For some reason, when I moved the file over all the contents of the file got wiped. I was able to edit index.php the same way and it worked like a charm so not sure what the deal was. Anyway, I added the line via file manager and now I can access my site but when I select the Network Setup option, I just get a blank white page.

  4. Hello Rick…

    I know the default url on multisite is like this :

    http://mydomain.com/newsite

    Is it possible to make this url to access new site :

    http://mydomain.com/demo/newsite

    If it is possible, can you tell me how to do something like that? because using the default url make some page on my website cannot access (page not found 404). I hope you can help to solved this problem.

    Thanks…

    • Rick R. Duncan says:

      Hey Fill,

      I’m guessing it’s possible but I don’t know how to do that off the top of my head. Unfortunately it’s more support than what I can offer from my blog’s comments section.

      Thanks,
      Rick

Leave a Comment

Please, only use your real name, not your business name or keywords. We moderate all comments before they appear on our website and will delete and mark as spam anyone not using their real name.

*