![]() |
VOOZH | about |
Installing WordPress in a subdirectory is a smart, efficient way to run multiple installations on the same domain without cluttering your root directory. Whether you’re setting up a secondary blog, client site, or staging environment, using a subdirectory keeps your structure clean.
This guide explains exactly how to install WordPress in a subdirectory manually, without relying on auto-installers. You’ll also learn why this method matters, how it affects URLs, and common mistakes to avoid.
/public_html/blog/, without adding an extra nested wordpress folder.When you install WordPress in a subdirectory, you’re placing it in a folder beneath your primary domain. For example:
This doesn’t isolate it on a separate domain or subdomain. The files live in a separate folder within your web hosting account, but your site remains tied to the primary domain. This approach is frequently used for:
Before beginning installation, have the following on hand:
This guide assumes that you’re working with Apache or LiteSpeed hosting, which covers most shared and VPS hosting environments. If you’re using NGINX, the basic steps apply, but permalink rewrites will require a different configuration.
Download the latest WordPress package from WordPress.org and extract it onto your local machine.
Create a MySQL (or MariaDB) database and a database user with full privileges. You can do this several different ways depending on your host and setup. Let’s walk through steps to create a MySQL database using cPanel:
Rename the WordPress directory to the subdirectory name you want to use. Use FTP to upload the renamed directory to your site’s web root (e.g., /public_html/) so the path becomes /public_html/subdirectory/.
Confirm that files like wp-config.php and folders like wp-admin/, wp-content/, and wp-includes/ are directly inside the subdirectory and not nested another level deep.
Now, navigate to the following URL: https://example.com/subdirectory/wp-admin/install.php, making sure to replace “example.com” with your primary URL and “subdirectory” with the name of your subdirectory. This will start the installation script.
If the wp-config.php is missing, WordPress will ask for database details and attempt to create the file. Otherwise, the installer will proceed.
Now, fill out information about your site, like a username, password, site title, etc. and click Install WordPress.
If the process was completed correctly, you’ll see the login screen and can log in to your dashboard.
For full instructions on installing WordPress and navigating a variety of potential scenarios, read the documentation from WordPress.org.
Once WordPress is installed, take a few steps to make your site secure, fast, and ready to use:
Understanding when to use a subdirectory over a subdomain or root install helps you avoid issues down the road.
Use a subdirectory when:
Avoid this setup if:
Some small missteps can lead to install issues, broken links, or admin lockouts. Here’s what to watch out for:
Yes, you can install multiple WordPress instances in different subdirectories under the same domain. Each installation must be placed in a separate folder within your root directory. For example, example.com/blog, example.com/store, and example.com/support can all run independently.
Each install requires its own database or a unique table prefix if sharing a single database. This setup is ideal for managing separate sites under one domain without using multisite or subdomains.
Installing WordPress in a subdirectory (e.g., example.com/blog) keeps the site under the same root domain. This is often preferred for SEO because search engines treat the subdirectory as part of the main site.
A subdomain (e.g., blog.example.com) is treated as a separate site with its own identity and authority. Choose subdirectories when content is closely related and should share SEO value with the main site. Use subdomains when the site needs branding or content separation.
No, installing WordPress in a subdirectory will not affect your main site if the subdirectory is properly isolated. Each WordPress installation runs independently as long as files are placed in their own folders and don’t overwrite root-level configurations.
However, misconfigured .htaccess rules or incorrect file paths can cause conflicts, especially if you attempt to serve the subdirectory install from the root URL. Always back up your main site before making major changes.
To access the admin dashboard for a WordPress site installed in a subdirectory, navigate to the login URL based on the folder name. For example, if WordPress is installed in example.com/blog, the admin URL will be example.com/blog/wp-admin.
Once logged in, you can manage the site like any other WordPress installation. All features, themes, and plugins work as expected. There is no functional difference in the dashboard compared to a root install.
Yes, you can move a WordPress site from the root to a subdirectory, but it requires careful handling. You’ll need to:
Always back up your site and database before proceeding, and test thoroughly after the move.
Yes, multiple WordPress installations in subdirectories can share the same database if each uses a unique table prefix. During installation, set a different prefix like wp_blog_, wp_store_, etc. This keeps each site’s data separate within the same database.
While this method reduces the number of databases required, using individual databases for each install offers better isolation and simplifies backup and migration processes.
Installing WordPress in a subdirectory typically has a positive or neutral impact on SEO, assuming proper configuration. Content in subdirectories is considered part of the main domain by search engines, allowing the site to benefit from shared domain authority.
This is especially useful when adding a blog or knowledge base to an existing site. However, ensure that canonical URLs, sitemap structures, and internal linking are configured correctly to avoid duplicate content or crawl inefficiencies.
Yes, subdirectories are a practical option for setting up staging or development versions of a WordPress site. You can install WordPress in example.com/staging or example.com/dev to test themes, plugins, or updates without affecting the live site.
Make sure to block search engine indexing by setting the site to “Discourage search engines from indexing this site” under Settings → Reading, or use .htaccess password protection to restrict access.
WordPress file and folder permissions in a subdirectory should follow the same standards as a root installation:
These settings ensure that files are readable and executable by the server, but not writable by the public. Never set permissions to 777, even in subdirectories, as this creates security risks.
Also, ensure the subdirectory inherits correct ownership from your hosting environment.
Misconfigured permissions can lead to update failures, plugin issues, or security vulnerabilities.
Jen Swisher
Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.
Explore the benefits of Jetpack
Learn how Jetpack can help you protect, speed up, and grow your WordPress site. Get up to 50% off your first year.
Explore plansHave a question?
Comments are closed for this article, but we're still here to help! Visit the support forum and we'll be happy to answer any questions.
View support forum