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. It’s a bit like creating a second WordPress site.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 WordPress page as a 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 WordPress page as 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 WordPress hosting subdomain 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 process. You’ll create an admin user name and password, and be ready to get to work on your new subdomain site. As a reminder, you’ll need to consider WordPress hosting for your subdomain and how this may impact your site.
Hosting a WordPress Subdomain
WordPress subdomains can be added to your existing hosting plan easily. Many hosting providers don’t include additional charges for adding a new WordPress page as a subdomain (or even adding multiple subdomains).
Exactly how this works does vary from provider to provider, though. So it’s always a good idea to check with your web host before making any changes to your account.
Alternative: Creating a Second WordPress Site
If you’d rather not use a subdomain, another option is to create a second WordPress site. This can be done using WordPress multisite, so that you can manage both sites from a single dashboard.
The main advantage of using a second WordPress site is domain name flexibility. You can choose whatever name you like, whereas a subdomain’s address will always contain your primary domain name. The main disadvantage is cost: a second site requires a second domain name and may also involve changes to your hosting plan, both of which cost money.
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 WordPress 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!