This is How to Create Multiple Sites on WordPress Using Subdirectories
Running a single WordPress site is great, but what if you need to manage multiple sites? Whether you're a web developer, digital agency, or running an online business, having the ability to easily create and manage additional WordPress sites can be incredibly useful.
Fortunately, WordPress makes it easy to create multiple sites within a single WordPress installation using subdirectories. In this article, we'll walk you through two different methods for setting up additional WordPress sites in subdirectories, even if you have limited database access on your server.
Method 1: Create a New Subdirectory and Install WordPress
The most straightforward way to create a new WordPress site in a subdirectory is to simply create a new folder on your server and install WordPress inside it. Here's how to do it:
-
Create a new subdirectory: Log into your web server via FTP or SFTP and create a new folder within your main WordPress installation directory. For example, if your main WordPress site is located at www.example.com
, you could create a new subdirectory called subdirectorysite2
.
-
Install WordPress in the new subdirectory: Next, download the latest version of WordPress and extract the files into the new subdirectory you just created. So in our example, you would extract the WordPress files into the subdirectorysite2
folder.
-
Run the WordPress installation: With the WordPress files in place, you can now run the WordPress installation process by navigating to www.example.com/subdirectorysite2
in your web browser. This will take you through the standard WordPress installation steps, including setting up a new database.
-
Configure the new site: After the installation is complete, you can start configuring your new WordPress site just like you would your main site. This includes setting up your theme, installing plugins, creating content, and so on.
That's it! With these simple steps, you've now created a brand new WordPress site within a subdirectory of your main WordPress installation. Users can access this new site by visiting the subdirectory URL, such as www.example.com/subdirectorysite2
.
Method 2: Create a New Template and Assign it to a Page
If you have limited database creation access on your server, you can still create a new WordPress site within a subdirectory, but the process is a bit different. In this method, you'll create a new template file in your existing WordPress theme and assign it to a new page.
Here's how it works:
-
Create a new template file: Log into your web server and navigate to the wp-content/themes/[your-theme-name]
directory, where [your-theme-name]
is the name of your current WordPress theme. Create a new file in this directory called page-subdirectorysite2.php
.
-
Copy the content of your main page template: Open the new page-subdirectorysite2.php
file in a text editor and copy the contents of your main page template file (usually page.php
). This ensures that the new template will have the same basic structure as your main site.
-
Modify the template as needed: Once you've copied the content, you can start customizing the new template file as needed. This might include changing the page title, modifying the content area, or adding any other custom functionality you need for the new site.
-
Create a new page and assign the template: Log into your WordPress dashboard and create a new page. In the page editor, locate the "Page Attributes" section and select the new template you created (e.g., "Subdirectory Site 2") from the "Template" dropdown.
-
Update the page permalink: Next, update the permalink for the new page to match the desired URL structure for your subdirectory site. For example, you could set the permalink to www.example.com/subdirectorysite2
.
-
Modify the .htaccess file: Finally, you'll need to update your WordPress .htaccess
file to ensure that requests to the new subdirectory site are properly routed. Add the following lines to the top of your .htaccess
file:
RewriteEngine On
RewriteRule ^subdirectorysite2/?$ /subdirectorysite2/index.php [L]
This tells WordPress to route all requests to the /subdirectorysite2/
URL to the index.php
file in the subdirectory.
And that's it! With these steps, you've now created a new WordPress site within a subdirectory of your main WordPress installation, without the need to set up a separate database.
Advantages of Using Subdirectories for Multiple WordPress Sites
There are several advantages to creating multiple WordPress sites using subdirectories rather than separate installations:
-
Shared resources: By using subdirectories, all of your WordPress sites can share the same hosting resources, such as the web server, database, and file storage. This can be more cost-effective than running multiple separate WordPress installations.
-
Centralized management: With all of your sites in a single WordPress installation, you can manage them more efficiently through a single dashboard. This includes updates, plugin management, user permissions, and more.
-
Simplified development and testing: If you're a web developer or digital agency, having multiple sites within a single WordPress installation can make it easier to develop and test new features or updates across all of your clients' sites.
-
Subdomain vs. subdirectory: Subdirectories are generally considered more SEO-friendly than subdomains, as search engines tend to treat them as part of the same website. This can be beneficial if you want all of your sites to be associated with the same domain.
-
Limited database access: As we've seen, the second method for creating multiple sites in subdirectories is useful if you have limited database creation access on your server. This can be a common scenario for shared hosting or managed WordPress environments.
Conclusion
Creating multiple WordPress sites within a single installation using subdirectories is a powerful and efficient way to manage a portfolio of websites. Whether you're a web developer, digital agency, or running an online business, this approach can help you save time, money, and resources while still allowing you to maintain separate, fully-functional WordPress sites.
By following the step-by-step instructions in this article, you can easily set up additional WordPress sites in subdirectories, even if you have limited database access on your server. Remember to keep your .htaccess
file updated to ensure that the subdirectory sites are properly routed.
If you're looking for a way to streamline your WordPress site management and take advantage of shared resources, creating multiple sites in subdirectories is definitely a strategy worth considering. And if you need help identifying and fixing any technical errors that could be impacting the performance and conversion rates of your WordPress sites, be sure to check out Flowpoint.ai – our AI-powered web analytics platform can help
Get a Free AI Website Audit
Automatically identify UX and content issues affecting your conversion rates with Flowpoint's comprehensive AI-driven website audit.