Step-by-Step Instructions for Installing WordPress in a Subdirectory


We’ll show you how to install WordPress in a subdirectory without affecting the parent domain name in this article. Do you want WordPress to be installed in a subdirectory? You can run multiple WordPress instances under the same domain or even a subdomain name if you install WordPress in a subdirectory.

Which is the better option for SEO? What is the difference between a subdomain and a subdirectory?

Normally, you’d want to create a WordPress website with its own domain name (such as wpbeginner.com). However, you may want to create additional websites using the same domain name in some cases.

Installing WordPress as a subdomain (http://newebsite.example.com) or a subdirectory (http://example.com/newwebsite/) is one option.

One of the most common questions we get is which is better for SEO.

Subdomains are treated differently than root domain names by search engines, who assign them rankings as if they were a separate website.

WPBeginner and our WPBeginner Videos website, for example, are treated as two separate websites by search engines.

Sub-directories, on the other hand, benefit directly from the root domain’s domain authority, and thus rank higher in most cases.

Installing WordPress multisite network is one way to create separate WordPress sites in both subdomains and subdirectories.

WordPress site management tools can also be used to create a single dashboard for managing multiple WordPress installations. You can, however, install separate instances of WordPress if you want to manage two websites separately.

Installation Requirements for WordPress in a Subdirectory

You’re good to go if you already have a WordPress website in the root domain name. Installing WordPress in a subdirectory has no special requirements.

All of the best WordPress hosting companies make it simple to run multiple WordPress websites from the same account.

If you use Bluehost, for example, you can create a new WordPress website right from your hosting dashboard.

Keep in mind, however, that the majority of shared hosting accounts have limited server resources. The performance and speed of all other websites on the same account will be affected by a sudden traffic spike on one of your websites.

If you’re just getting started, shared hosting is a good option. Keep in mind that as your company grows, you’ll need to upgrade to managed WordPress hosting.

So, let’s take a look at how to quickly and easily install WordPress in a subdirectory.

Step 1: Make a Subdirectory in the Root Domain Name.

This is where the WordPress files will be installed. To begin, make a subdirectory or folder beneath the main website.

Use a FTP client or cPanel’s File Manager to connect to your WordPress hosting account.

The /public_html/ folder is usually the culprit. Go to the root folder of your website once you’ve connected. Your WordPress files and folders will be visible if WordPress is already installed in the root folder.

After that, right-click on the folder and choose ‘Create new directory’ from the menu.

This will be part of the URL for your new WordPress site, and it will be what your users type into their browsers to get to it. When choosing a name for your subdirectory, you must be cautious.

If you name this directory travel-guides, for example, the address of your WordPress website will be:

http://travel-guides.example.com/

Step 2: Upload WordPress Plugins and Files

At the moment, your newly created subdirectory is empty. Let’s change that by putting WordPress files on the server.

To get started, go to WordPress.org and click on the download button.

Your browser will now download the latest WordPress software to your computer as a zip file.

You must select and extract the file after it has been downloaded. To extract the file, Mac users should double-click it, while Windows users should right-click it and select ‘Extract All.’

After unzipping the file, look for the ‘wordpress’ folder, which contains all of the WordPress files.

Let’s move these files to your new subdirectory now.

Using an FTP client, connect to your website and navigate to the subdirectory you created in the first step.

Go to the ‘wordpress’ folder you just extracted in your FTP client’s local files panel.

Select all of the files in the folder and move them to the new subdirectory.

Step 3: Make a brand new database

WordPress uses a database to store all of your content. To use with your new WordPress site installed in a subdirectory, you’ll need to create a new database.

To begin, go to your WordPress hosting account’s cPanel dashboard and log in. Under the databases section, select ‘MySQL Databases.’

All you have to do now is look for the ‘Databases’ section. Note that your hosting dashboard may differ from the example above.

Enter a name for your new database on the next screen, then click the ‘Create Database’ button to continue.

To return to the Databases page, click the Go Back button. The new MySQL database will now be created by your cPanel dashboard.

After that, you must create a database username and password.

To continue, click the ‘Create User’ button. Simply scroll down to the section titled “MySQL Users” and enter a new username and password.

After that, you must grant this newly created user permission to access the database you created earlier.

Scroll down to the †Add user to database†††††††††â After that, choose your MySQL username and then your newly created database.

To continue, click the Add button.

The MySQL user will now have full access to your newly created database, thanks to Cpanel.

Step 4: Download and install WordPress

Now that you have everything in place, you can install WordPress. Simply type the following URL into a web browser to access the directory you created earlier:

http://example.com/the-name-of-your-subdirectory/

To begin, choose a language for your WordPress website and then click the continue button. The WordPress installation wizard will appear.

Fill in the database information and hit the submit button. After that, you’ll be prompted to enter the name of your WordPress database, as well as the database username, password, and host.

WordPress will now connect to your database and display the following success message:

To continue, click the ‘Run the install’ button.

You’ll be asked to give your website a title and select an admin username, password, and email address on the next screen.

To continue, click the ‘Run install’ button after entering your website details.

WordPress will now complete the installation of your website and display the following success message:

You can now access your newly installed WordPress website in the subdirectory.

Step 5: Correct Permalinks

If you have a separate WordPress installation in the root directory, your subdirectory’s.htaccess files will conflict. Your website will experience 404 errors as a result of this.

To fix this, edit the.htaccess file in your WordPress subdirectory installation. Replace the following code with the following code in your.htaccess file:

Remember to replace /your-subdirectory/ with the name of your own subdirectory.

We hope this article was helpful in getting WordPress installed in a subdirectory. You might also be interested in our step-by-step WordPress SEO guide for beginners.

You can also find us on social media sites such as Twitter and Facebook. Please subscribe to our YouTube Channel for WordPress video tutorials if you enjoyed this article.

    Beginner’s Guide to Installing Google Analytics in WordPress

    How to Transfer Your Blog from WordPress.com to WordPress.org Correctly

    Step-by-Step Instructions for Starting Your Own Podcast

    15 Things You Must Do Before Changing WordPress Themes Checklist

    Editorial Staff Information

    Over 1.3 million readers around the world rely on it. WPBeginner’s Editorial Staff is a group of WordPress experts led by Syed Balkhi.

    Thank you for providing this resource.

    This guide was extremely helpful in clearing the air. On our next website, we intend to include subdirectories.

    However, I have a question.

    Is there a limit to the number of subdirectories that a WordPress site can have?

    At this time, there is no hard limit on the number of directories that can be created.

    The rest of the files have been uploaded… how do I upload them all??? I’m having trouble uploading the wp-admin, wp-content, and wp-includes folders to the subdirectory… Hello, and thank you for this article…

    It depends on the reason for your inability; if you contact your hosting provider, they should be able to help, but it could also be a permissions issue with your user.

    Thank you for your help. Is it possible to include the name of the subdirectory in the URL, such as example.com/seo/how-to-rank? to https://www.example.com/how-to-rank

    If you don’t want the subdirectory to show up in your URLs, we recommend installing the site on your primary domain rather than using redirects to get rid of it.

    Thank you for writing this article. It’s extremely instructive. Will installing WordPress in a subfolder have an impact on the site’s overall speed?

    It shouldn’t be the case.

    In your htaccess code example, there appears to be an error.

    should be # WORDPRESS START

    /your-subdirectory/index.php RewriteRule %REQUEST_FILENAME! RewriteCond – [L] $ On RewriteBase /your-subdirectory/ RewriteRule index.php RewriteEngine -e -f RewriteCond %REQUEST_FILENAME %REQUEST_FILENAME %REQUEST_FILENAME %REQUEST_FILENAME % [L] [L] [L] [L] [

    # FINAL WORDPRESS

    change line 5 rewriterule rewriterule rewriterule rewriterule re

    Thank you for noticing that; while it isn’t strictly necessary, we’ll look into updating the article.

    As far as I’m aware, WordPress’ default post URL is domain.com/blog… I want to create a website with a wordpress subdirectory, with domain.com as the main site and domain.com/blog as the secondary site… Will it have a negative impact on SEO?

    The use of blog as a subdirectory should not have a significant impact on SEO. WordPress does not default to using the /blog URL; it is simply the most common one.

    Is it necessary to install and manage the same plugins separately if I install WordPress on the main domain and subdirectories separately and manage the sites separately?

    You can also read our article below for some recommended tools for managing multiple sites: The plugins are managed for each individual site if it’s on a different site, even if it’s in a subdirectory.

    https://kiuz.it/showcase/managing-multiple-wordpress-sites-easily/

    I misplaced my hosting information. Good day, Sir. Is it possible to create a subdirectory without logging into Cpanel? However, I have WP credentials; is it possible to create a subdirectory in WordPress using a plugin or some other method?

    You’ll need access to your hosting, and you should be able to contact your hosting provider for help regaining access to your account.

    Thank you very much. This actually worked! Thank you so much….

    Thank you for taking the time to read our guide; we hope it was useful.

    Because I want my subdirectory site to use the same template and plugin. Hello, I’d like to know if I can copy all of the files from my current folder to a subdirectory.

    Instead of installing the site on staging, you could have all of your content on a subdomain of your choice and modify the content to be that of your new site, as shown in our guide on how to make a staging site below. Our guide to creating a staging environment for a WordPress site can be found here: https://kiuz.it/wp-tutorials/how-to-create-staging-environment-for-a-wordpress-site

    Should the fix permalink still be relevant and work without issue if I created a new subdirectory from another subdirectory? Should I still use the same permalink fix for firstwebsite.com/firstsubdir/secsubdir/ if the second subdirectory is firstwebsite.com/firstsubdir/secsubdir/?

    Sorry, but English is not my native tongue.

    The second subdirectory would need to be included in the permalink change, but it should still work.

    Thank you for a well-written tutorial.

    To be clear, I’d install WordPress in mydomain.com/sub/, but I’d prefer to access it by going to mydomain.com and having mydomain.com displayed in the browser so that visitors can bookmark my URL. Is it possible to install WordPress in a subdirectory but access it via the main domain URL, with the main URL still visible in the browser address bar?

    Is it feasible to put it together?

    It’s possible, but you’d have to check with your hosting provider to see if it’s permitted. If you contact your hosting company, they should be able to help you.

    Will installing WP in a subdirectory make the pages load faster?

    The location of your site on your host should have no effect on the loading time of your site.

    If you could just give me a hint, I’d be grateful. I just finished reading the article and have a question: how can I have the same header and footer in the parent directory as the wordpress installation? Salutations, Thank you…

    The most straightforward solution is to use the same theme on both sites.

    Hello, Thank you so much for this fantastic tutorial; it works perfectly!

    We’re glad our guide was useful.

    It was extremely beneficial! Please allow me to ask one question.

    Is it necessary for me to include the following line:

    /your-subdirectory/ RewriteBase

    for each install in the main WordPress installation’s subdirectory?

    Thank you.

    Yes, we would advise doing so to avoid any problems with the subdirectory.

    It was extremely beneficial to me! Thank you for providing this data!

    Thank you for taking the time to read our guide; we hope it was useful.

    Without using the plugin, I manually copied my WordPress files to the root folder. Hello there. I removed the /wordpress from WP_HOME and WP_SITEURL in the wp-config file in the root folder. The original database was then copied into a new one, where the siteurl was changed to reflect the new location, the root folder.

    As a result, I was able to access my new location’s wp-login, but not any further.

    When I went to my site, I got a warning that there were too many redirections.

    Do you have any suggestions?

    For starters, go through the steps in our article here: https://kiuz.it/wp-tutorials/how-to-fix-error-too-many-redirects-issue-in-wordpress/.

    Thank you for providing a step-by-step guide for WP subfolders. How to create a precise Google news xml sitemap in WordPress is something I’ve never figured out.

    The required markup should be added by most SEO plugins, allowing you to be added to Google News. If you’re using an SEO plugin, you should contact the plugin’s support team to find out what settings they recommend.

    Thank you for writing this article. I’m having trouble converting this subdomain or subdirectory where WordPress is installed to the main root of the website and replacing it with the main site. What am I supposed to do?

    You could look at our guide here: https://kiuz.it/wp-tutorials/how-to-get-rid-of-wordpress-from-your-wordpress-site-url/ to see what we mean.

    Thank you so much for these. Not only for these reasons, but also for this… Hello, Team! All of your other blog posts are extremely useful to us, and I greatly appreciate your efforts.

    Thank you very much. And I need a little help, I did exactly what this post says, I installed WordPress in a subdirectory, but I’m having trouble receiving emails from the contact form. When it was on a subdomain, it worked fine, but when it’s on a subdirectory, it’s not receiving the form submissions, it’s loading but not getting submitted. Please assist me in this matter.

    If you’re having trouble receiving emails, try using SMTP: https://kiuz.it/plugins/how-to-send-email-in-wordpress-using-the-gmail-smtp-server/ If they aren’t being saved in your site when they should be, you should contact the support team for your form plugin.

    I read each and every one of your posts. Thank you for the information.

    I just have a skepticism. I created a new WP install using my Host provider, but when I looked in the subdirectory, there was no.htaccess file. Is it necessary to create a new.htaccess file? Is it going to make mistakes in the future?

    If you resave your permalinks, WordPress should generate the htaccess file. If you still don’t see it, it’s possible that you don’t have the option to show hidden files turned on.

    Thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank

    Thank you very much.

    How do you do it? Is it possible for me to change the name of my subdirectory? Around three weeks ago, I successfully installed WordPress in a subdirectory, and I had already uploaded a theme, some plugins, and created some posts. Hello there, For my subdirectory, the name is Chose, and what appears after my original website URL is espaol; I want to change this because I read somewhere that characters like es could cause SEO issues….so now I’m concerned; thank you for your time.

    If your site has been up for a while, you should follow the steps outlined in this article: https://kiuz.it/wp-tutorials/how-to-properly-move-wordpress-to-a-new-domain-without-losing-seo/. You don’t need to notify Google if you just installed it on the subdomain.

    Hostinger is what I use. Hey, I just did everything you said except for changing the htaccess file. My website is still operational.

    Is it necessary to change the htaccess file? Is it likely to cause an error in the future?

    If you contact your host, they should be able to tell you if the redirect has been set up for you.

    That is what I mean to say. I just got it to work, but I’m wondering if it increases the time it takes for both pages to load.

    ( I’m currently testing this on localhost, but I’ll be implementing it on my main server in one or two days )

    Although I have two websites, I only have one domain.

    I’m just curious if this will increase bandwidth consumption and load time.

    Assume my main webpage is 1 MB in size and my secondary website is also 1 MB in size. When someone visits the main page, it loads the entire 1+1 2MB size.

    Hello, Owaiz.

    Yes, depending on your traffic, it will increase bandwidth usage. Because both WordPress installations share resources, traffic on one website will have an impact on the performance of the other.

    Thank you a lot!! Wow, it worked right away!

    Thank you so much for being so clear and helpful.

    After that, my website displayed a white screen of death.

    Installing it is extremely beneficial for beginners.

    Hello, I’m not sure what you’re talking about. What’s the difference between installing WordPress in a subdirectory versus simply creating multiple pages???

    I’m a newbie.

    I believe I followed your instructions to the letter. So, what should I do now…? However, when I try to customize my theme on the subdirectory, it redirects me to the root domain’s wp customizer.

    Hello, could you please assist me?

    Is there anyone who can assist? I used ftp to install my local wordpress to the subdir, but the css isn’t working properly, and I’m not sure what’s wrong with my wordpress because I followed this step.

    Thank you very much.

    Hello there,

    I’m following your instructions for creating the sub directory, but I’m getting the following error:

    HTTP ERROR 500)))))))))))))) When I try to open the URL after FTP uploading all of the files to the folder, it redirects to wp-admin/setup-config.php and returns a 500 server error. (This page is currently unavailable because simplyrent.in is unable to handle this request.)

    Subdirectories, according to what I’ve heard, are ranked as part of the root domain. However, even for exact match keyword searches, my subdirectory does not rank. I used Fetch as a Google Tool to index Subdirectory. I’m not sure what the issue is.

    I submitted it to Google Search Console and created separate robot.txt and sitemap files (the sitemap is still pending after two days).

    Should I give Google more time to crawl subdirectories?

    Please play the video again. Thank you very much!

    Hello, Jyotishman.

    It is up to search engines to determine how your website will appear in their results. You can only do one thing: optimize your website for SEO and follow best practices.

    Thank you for sharing this tutorial with us. It came in handy after I spent hours trying to figure out why I was getting 404 errors all day.

    Simply add this to your DirectoryIndex index.php in your.htaccess file and thank me later!

    Login for the main directory and subdirectories

    Hello there. I created a subdirectory with its own WordPress installation. It appears that the user must create an account for both the main and subdirectories, as well as login for both.

    and the other way around. If a user has already logged in to the main site, he or she does not need to log in again to the subdirectory site. Is there a way to allow a user who has logged in to one of the main or subdirectory sites to access the other without having to log in again?

    Thank you.

    THOUGH

    You don’t need to manually install WordPress in a directory/subdomain; all you have to do is change the name of the directory where Softaculous will install WordPress and create a database, among other things. If you use Softaculous, wordpress is installed to the default directory named wp by default.

    Thank you for providing this tutorial. It might be interesting to demonstrate how to configure cPanel redirects to this subdirectory when you have some free time. I can’t, for example, point my domain name to a WordPress subdirectory called /public-html.

kiuz
Logo
Enable registration in settings - general