Import WordPress Multisite with Subdomain URL
In a separate article, we showed you how to import WordPress Multisite with sub-directory URL.
Most of the actions, described in that article, are also valid for this case, but of course there is one significant difference that we'll explain in detail here.
A multi-site network with sub-directory URL needs only one configured site domain for all sites to work because the individual URLs differ only by the keyword after site domain:
From a DNS point of view, we need to configure only one site domain and all sites from the entire multi-site network will use this site domain.
The multi-site network with sub-domain URL needs a configured subdomain for each site even if there are hundreds of sites.
Fortunately there is a technical solution that relieves us from manually configuring a subdomain every time we add a new site to the network and this solution is called wildcard DNS record.
So first we will configure a primary site domain and then we will configure a wildcard record for all subdomains so that DNS can correctly target the requests for each subdomain to the corresponding virtual site on the network.
As we said it earlier you can follow these tutorials using separate domain (addon domain) or sub-domain as a site domain.
Here we will repeat the full list of necessary actions as well as the correct order in which they should be accomplished.
- Download files via FTP to the local computer;
- Export a MySQL database archive from the remote server via phpMyAdmin to the local computer;
- Create and Configure site domain in cPanel;
- NEW! Create and configure a wildcard DNS record for subdomains in cPanel;
- Create a new MySQL database in cPanel;
- Edit the
wp-config.phpfile on the local computer;
- Edit the content of MySQL archive on the local computer;
- Import the multi-site files into the site's directory via FTP;
- Import the MySQL archive from the local computer into the new MySQL database;
We remind you that the sequence of actions is important because, you can not upload the files via FTP, if you have not configured the site domain.
Also, you can not edit the database archive before you have generated and downloaded this archive to your local computer.
In this article, we'll show how to execute the different step four from the above list.
Configure a wildcard DNS record for subdomains in cPanel
We assume that step three was executed properly and the domain of the main site on the network is configured correctly.
Now we open cPanel > Domains > Subdomains again to configure thr wildcard record that will configure all subdomains of site domain (
wpmuimport.example.com) to the site directory (
Click Domains > Advanced Zone Editor to make sure the DNS records are properly configured:
Select domain – in our case
If you are following this tutorial using addon domain for the main network site, these records will look like this way:
example.com 14400 IN A 22.214.171.124
*.example.com 14400 IN A 126.96.36.199
Wildcard record makes it possible for us to create unlimited number of sites with any keyword in front of the site domain without having to manually configure a subdomain for each site on our network.
To finish multi-site import, you must complete all next steps exactly as described in the import multisite with subdirectory url article.
Once all the steps have been completed correctly, we need to test our network of sites:
Test admin panel login, add another site, create new Pages and Posts …
Congratulations, your multisite network with subdomain URLs works just fine.