
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!