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:
- WordPress design agencies might want to build a client’s website on a public accessible server
- WordPress theme builders might want to showcase their premium WordPress themes on a sub-domain using sub-directories
- WordPress plugin builders might be testing a new piece of functionality on their latest version
- 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.
OK, lets get started!
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:
Your file should look like the image below.
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
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.”
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.
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.