How to install WordPress on subdomain: 2 proven methods

How to install WordPress on subdomain: 2 proven methods

A subdomain is a part of a domain name used for creating independent websites that serve as extensions of the main website. They typically house slightly different content that is still relevant to the primary domain.

For example, if you run an online store on your primary domain but want to add a blog, you can use a subdomain for it. It will be on a separate website but still connected to the main store site. An example of the subdomain would be blog.example.com.

If you want to install WordPress on subdomains and learn more about them, this article is for you. We will elaborate on two ways to create a subdomain, two methods to install WordPress on a subdomain, and what a subdomain can be used for.

1. Create a subdomain

We will show you two ways to create a subdomain – through hPanel and the DNS zone editor.

hPanel is Hostinger’s easy-to-use proprietary control panel. It comes with all of Hostinger’s WordPress web hosting plans.

The DNS zone editor, on the other hand, is a feature most web hosting providers offer. It is used to create and manage DNS records.

Through hPanel

In order for this method to work, make sure your domain is pointing to Hostinger. It may take up to 24 hours after the creation of the subdomain for it to work properly.

Here are the steps to create a subdomain via Hostinger’s hPanel:

  1. Go to Domains Subdomains from the hPanel dashboard.
  2. Enter a new subdomain name in the Create a New Subdomain section. You can also specify a custom folder name for it by checking the Custom folder for subdomain box. Once finished, click Create.
The Subdomains section in Domains menu, showing a form to create a new subdomain
  1. Scroll down to find the subdomain you created on the List of Current Subdomains. Here, you can check the subdomain’s directory information and delete it.
List of current subdomains in Hostinger's hPanel

Through the DNS Zone Editor

Another way to create subdomains is via the DNS zone editor located on your web hosting provider’s control panel. In this step-by-step guide, we will use hPanel.

Follow these steps to create a subdomain via hPanel’s DNS Zone Editor:

  1. Go to AdvancedDNS Zone Editor from the hPanel dashboard.
  2. On the DNS Zone Editor page, find the Manage DNS records section. Select A from the drop-down menu of DNS record types. Then, input a name, the IP address the subdomain points to, and the time to live (TTL). When finished, click the Add Record button.
The main view of the DNS Zone Editor on hPanel
  1. If the process is successful, the newly created DNS record will appear on the list of DNS records. Allow up to 24 hours for the change to take full effect.

2. Install WordPress on a subdomain

Once you have created a subdomain, you can install WordPress on it.

There are two ways to do this – using the WordPress automatic installer or manually.

Through the auto installer

The auto installer helps people install various applications easily in a few clicks. We recommend beginners use this method to install WordPress to lower the chance of any errors.

Here are the steps to install WordPress on a subdomain using the one-click installer:

  1. Go to the Websites page from your hPanel dashboard and click Dashboard next to your chosen subdomain.
Hostinger's Websites page, highlighting the button to access a subdomain's dashboard area
  1. Open the Website menu on the left sidebar and click WordPress.
  2. On the Overview tab, select Install to start the setup process. Make sure the drop-down field points at your chosen subdomain.
WordPress installation menu in Hostinger, highlighting the button to install WordPress on a subdomain
  1. The Install WordPress pop-up window will appear. Fill in all of the required information in the fields provided. Click Next and Install.
WordPress installation pop-up in Hostinger
  1. Once the installation is complete, you will be redirected to the hosting dashboard for the subdomain you just created. Click the Admin Panel button to access the WordPress admin dashboard and begin customization.

Installing WordPress on a subdomain manually

The manual method to install WordPress is a bit more complicated. However, it is useful if the automatic installer fails to work properly.

You can also install WordPress manually if you don’t want the built-in plugins provided by your hosting provider.

There are two ways to do this: by configuring an FTP client like FileZilla or using your hosting provider’s file manager. In this guide, we’ll use hPanel’s File Manager.

The following are steps to install WordPress on a subdomain manually:

  1. Head to the official WordPress website and download the WordPress package. Download the latest WordPress version and unzip the files afterward.
The official WordPress package download page
  1. Next, upload the website files from your computer to the public_html/subdomain folder. To do this, log in to the hPanel dashboard and navigate to File manager.
  1. Click on the public_html root folder. Once you’re in the folder, find the subdomain folder and open it. Then, click the Upload Files icon on the navigation bar and upload the WordPress files you previously extracted.
The subdomain folder in File Manager with the Upload icon highlighted
  1. Create a new database and database user so the web application can connect to it to retrieve information. To do this, return to the hPanel dashboard and open Databases Management.
  1. In the Create a New MySQL Database and Database User section, fill out the database name, username, and password in the fields provided. Once finished, click the Create button. Don’t forget to note all the database credentials, including the alphanumeric strings. This information will be needed later.
  1. In the Create a New MySQL Database and Database User section, fill out the database name, username, and password in the fields provided. Note all the database credentials, including the alphanumeric strings as you’ll need this information later. Click Create once you’re done.
The "Create a New MySQL Database and Database User" on Hostinger hPanel's MySQL Databases page
  1. After creating the MySQL database and database user, modify the wp-config.php file to tell WordPress about your new database configuration. Return to the File Manager, click on the public_html folder, and open the subdomain folder.
File Manager with public_html folder opened and subdoain folder is selected.
  1. Find the wp-config-sample.php file and right-click on it. Select Rename, change the file name to wp-config.php, and click Rename when finished.
wp-config-sample.php file in File Manager is selected with a right-click and rename option is highlighted.
  1. Right-click on the wp-config.php file and select Edit.
wp-config.php file in File Manager is selected with a right-click and edit option is highlighted.
  1. On the window that opens, look for DB_NAME, DB_USER, and DB_PASSWORD strings. Replace database_name_here, username_here, and password_here with the information you collected earlier, including the alphanumeric strings. Click the Save icon and close the file.
wp-config.php file opened and DB_NAME, DB_USER, and DB_PASSWORD strings are highlighted.
  1. To proceed with the manual WordPress installation, type the subdomain’s URL into your browser to access the WordPress setup page. Select a desired language from the menu and click the Continue button.
The language selection menu of WordPress setup page
  1. Fill in the required website and admin information. Check the box next to Search engine visibility if you don’t want the site to be visible to search engines. Once finished, click Install WordPress to proceed with the installation process.
The Welcome page of the WordPress installation process
  1. Once the installation is finished, you will be notified that WordPress has been installed. Click Log In to access the admin dashboard and begin customizing your WordPress site.
The Success page of the WordPress installation process

What is a subdomain for

Now that we have covered what a subdomain is, how to set it up, and how to install WordPress on one, we will elaborate on what people use subdomains for.

Expanding and organizing your web content

Subdomains are useful for creating websites separate from the main site while still using the same root domain. The separate WordPress site on the subdomain can have its own configuration and design.

Since the root domain remains the same, visitors will recognize that the subdomain website belongs to the same brand or company. This lets you maintain a consistent brand identity.

In addition, subdomains help you save money as you can make as many as you need without having to purchase and register multiple domains.

Dividing content across subdomains and specializing each subdomain for certain content or a specific target audience will also improve user experience.

For example, the blog.example.com subdomain can be used to separate blog posts from the main website’s content.

If you dabble in multiple areas of the creative industry, try using several subdomains to showcase different skills. You can use one subdomain to display your work as an artist, another to show off your photography skills, and a third to present your web design portfolio.

You can also set up subdomains to cater to specific groups of people – one subdomain dedicated to guests and another to registered users. In addition, subdomains can be used to target users from different regions.

Testing a new site

Subdomains can serve as testing or staging grounds for new websites or new developments on an existing site.

On a subdomain, it’s possible to test out new features, themes, designs, layouts, plugins, or updates – all without affecting the actual live site.

Trying out new features or updates before committing to them is highly inadvisable, as the new elements can fail to appear how they’re supposed to. Errors can occur on the website as you’re testing the features, resulting in a site that’s inaccessible to users.

This can be especially harmful to mission-critical websites that must remain up at all times. Any downtime is detrimental to business websites, as it will lead to losses of traffic and potential customers.

Creating a mobile version of your site

For webmasters, making sure their websites can be viewed on all kinds of devices is a must. Many of them use subdomains for mobile versions of their sites. A subdomain used for this purpose will usually look something like m.example.com.

Mobile sites are especially important for SEO. For example, Google employs mobile-first indexing. This means it mainly uses the mobile version of websites for indexing and ranking.

As a result, websites without a mobile version or a responsive design will most likely suffer in terms of search engine ranking.

Starting an online business

If you have a website and want to build an eCommerce store on it, using a subdomain is an excellent way to do so.

The store will be on a separate website using the same root domain, letting people know that it is part of the main site. This way, you can launch an online store while leaving the main WordPress site untouched.

An example of this is the official In-N-Out Burger website. It houses an online store on the shop.in-n-out.com subdomain.

The In-N-Out Burger merchandise store

Another example is the official Porsche website. Its subdomain shop.porsche.com features Porsche merchandise, such as sunglasses and duffel bags.

The Porsche merchandise store

If you have an online business idea, you can use a subdomain to set it up separately from your main site.

What to consider before creating a subdomain

Despite the benefits of using a subdomain, using one may not be right for you, depending on your circumstances.

To help you decide if you should use a subdomain, we have listed some factors to consider before you install one:

  • More work when building backlinks. Search engine crawlers regard subdomains as separate websites. This means you will need to put extra effort into collecting quality backlinks not only for the main domain but also for any subdomains if you want them to rank high on search engine results pages.
  • Multiple admin dashboards. As all the subdomains have separate WordPress installations, users will have to navigate between different admin dashboards to manage their site, which can be time-consuming.
  • Must add multiple website properties. You must add and verify each subdomain on Google Search Console. Settings customization and web performance tracking are also separate for each subdomain.

Subdomain vs subdirectory: which one is better

A subdomain is a child of the parent or main domain, sitting outside of the parent domain. On the other hand, a subdirectory or subfolder is a page that is a part of the main domain.

In a URL, the subdirectory will always follow the root domain. For example, /blog is a subdirectory of the root domain in the example.com/blog URL.

Whether to use subdirectories or subdomains depends on your needs as well as the platform you are using.

If the content you want to feature is closely related to the main subject of the root domain, it’s a good idea to use the subdirectory system. On the other hand, if the content differs greatly from the main focus of the root domain, we recommend using a subdomain.

That said, you’ll have to set up multiple subdirectories to leverage the WordPress multisite feature.

Let’s take a look at the official website of the New York Giants, a professional American football team. It uses subdirectories for content such as team news, videos, photos, schedule, roster, and podcasts.

Here is what the giants.com/video/ subdirectory looks like:

The Video page of the New York Giants official website

For its merchandise shop, however, the site uses the shop.giants.com subdomain:

The New York Giants merchandise store

Subdomains and SEO

SEO experts debate the effects of subdomains on SEO.

According to John Mueller, a Webmaster Trends Analyst at Google Search Central, using subdomains is fine for ranking on Google.

As we mentioned earlier, however, each subdomain has to be submitted to the Google Search Console separately. As subdomains are treated as separate websites, it may take a few days for the content to be crawled and properly indexed before ranking.

That said, using subdirectories for closely linked content is preferable and may lead to increased traffic.

Conclusion

A subdomain is an independent website that sits outside of the root domain but is still connected to it. Blog.example.com is an example of what a subdomain looks like.

We have discussed two methods of installing WordPress on a subdomain – using the WordPress Auto Installer or manually.

For beginners, we recommend installing WordPress with the automatic installer. Although the manual WordPress installation is more complex, it is useful when the automatic installer fails or when you want to install WordPress without the plugins included with your web hosting.

Subdomains can be used for various purposes, such as expanding and organizing web content, testing new websites, creating a mobile version of the site, and starting an online business.

Before you install a subdomain, remember that you’ll have to put extra effort into building backlinks, managing separate WordPress admin dashboards, and adding multiple websites to the Google Search Console.

We hope this guide has helped you install WordPress on subdomains. If you have any comments or questions, let us know in the section below.

Install WordPress on subdomain FAQ

How do I link my WordPress page to a subdomain?

The steps to link a WordPress page to a subdomain depend on your hosting provider. First, create a subdomain in the DNS settings of your hosting account. Once you have the subdomain, head to your WordPress dashboard to install the WP Subdomains plugin to use the wildcard redirects feature.

Can I redirect a URL to a subdomain?

Yes, and doing so can help visitors find the correct page on the web. Redirection of URLs can be done in several different ways, depending on what type of website you have and the resources available to you. The most common methods include server-side redirection.

Author
The author

Tashia T.

Tashia is passionate about all things website development, digital marketing, and eCommerce. She strives to spread her knowledge and help people navigate the online world through her words, one article at a time.