How to Install WordPress on a Subdomain
The thought of running a second or even a third instance of WordPress to compliment your current website might seem complicated and confusing. However, there are times when making a small portion of your site perform in a certain way might alter it too much for your liking.
That’s where subdomains come in. Simply put, subdomains are nested hierarchically inside your site’s primary domain. When you choose to install WordPress in a subdomain, you create the opportunity to build a separate and unique website that can still be tied to your main site in a meaningful way.
In this article, we’ll go over how to install WordPress on a subdomain. We’ll also discuss some of the potential benefits of taking this approach. If you’re ready, let’s get started!
Installing WordPress on a Subdomain
A subdomain can be considered a partner to your website’s main domain. It gives you the option to use the recognizable portion of your primary domain name while adding a new element to it. This new domain has all the opportunities any domain has, but also maintains a visible link to the primary one.
For example, our website’s primary domain is wpengine.com. Let’s say we wanted to run a separate WordPress installation explicitly designed to house an eCommerce store for branded merchandise. To do that, we could create a new subdomain called shop.wpengine.com, and install and configure a fresh version of WordPress on it.
Once you’ve decided to add a new installation of WordPress on a subdomain, however, you’ll want to keep a few things in mind regarding Search Engine Optimization (SEO). Google specifically treats subdomains as separate and individual websites, regardless of how closely linked they are to your main website.
Therefore, you’ll want to make sure you’ve followed some key best practices regarding subdomain indexing and SEO. That way, you won’t harm the rankings of either site.
How to Install WordPress on a Subdomain
Now that you understand why you might want to create a subdomain, let’s talk about how to do it. The following five steps will take you through the entire process.
Step 1: Create a Subdomain of Your Root Domain
Depending on which web host you use, creating a subdomain can be quite easy. Since subdomains use the existing domain name you’ve already registered, they are usually free to create.
If you’re hosting your site here at WP Engine, we’ve built domain management right into our User Portal. First, it’s best to make your account a multisite account. This is easy to enable in your User Portal under Sites > Utilities:
You can add domains in the User Portal as well. Once you navigate to Sites and select the site you’re interested in using, you can find Domains in the menu. Simply click on Add Domain, and follow the prompts:
If you’re using another hosting provider, you’ll likely have access to cPanel or a similar dashboard. Once you log in to your cPanel, you’ll see a Subdomain option in the Domains section of the dashboard:
Click on Subdomains to access options for creating space for your new WordPress installation. You’ll be directed to designate your subdomain name, and select the primary domain you want to assign it to:
Once you complete that step, you can either open your file manager within cPanel, or navigate back to your dashboard and locate any auto-installer options you have access to.
Step 2: Download WordPress
If you choose to install WordPress manually, you’ll need to first download the software. You can do this by going to the WordPress website and clicking on the Get WordPress button. This will take you to the download page:
Once you’ve downloaded the zipped file, take note of where you saved it. You’ll also want to go ahead and unzip the files.
Step 3: Create a New Database and Users
Next, you’ll need to create a new database with users for your subdomain. You can do this in your cPanel by locating the Databases section of your dashboard:
Depending on your host, you might have the option to use a MySQL Database wizard. Otherwise, you can simply click on MySQL Databases. You’ll be taken to a page with information about your current databases, and the option to create new databases and users:
Once you set up the database and users for your subdomain, you just need to make sure you take the final step and actually assign your new users to the subdomain. In addition, you’ll need to enter your database name and information later during the installation process, so you might want to keep it handy.
Step 4: Upload Your WordPress Installation Files
Next, you’ll be uploading the WordPress installation files you previously downloaded and unzipped. You can either work within your cPanel’s file manager, or opt to use your favorite Secure File Transfer Protocol (SFTP) application.
In the cPanel file manager, you’ll see your new subdomain’s file tree:
You can now upload your WordPress installation files into the public/html directory of your subdomain. Then, all that’s left is to complete the installation process.
Step 5: Run the WordPress Installation Script
Now you’re ready to run the WordPress installation script. You can do that by going to mysubdomain.mysite.com/wp-admin/install.php in your web browser. If you did not set up your wp-config.php file manually, WordPress will prompt you to create one now:
This is also where you’ll need your database information. WordPress will use these details to create the wp-config.php file for you.
Once that is successfully completed, you’ll be guided through the rest of the standard WordPress setup. You’ll create an admin user name and password, and be ready to get to work on your new subdomain site.
Expand Your Site With WP Engine
Sometimes the additions you want to make to your site just don’t fit within your current theme or structure. This is an excellent opportunity to expand your site’s offerings by creating a subdomain and running another instance of WordPress.
Here at WP Engine, we want you to feel confident about taking on new projects. That’s why we offer WordPress resources for users and developers alike. We also have a wide variety of hosting plans and solutions, to help you create unique digital experiences for your users!