Install WordPress in a subdirectory of an existing site – WordPress Sub-directory | WP Learning Lab

#wordpress installieren –>


Mit dem Laden des Videos akzeptieren Sie die Datenschutzerklärung von YouTube.
Mehr erfahren

Video laden

Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist:
Install WordPress in a subdirectory of an existing site – WordPress Sub-directory | WP Learning Lab

Download your exclusive 10-Point WP Security Checklist:

A WordPress subdirectory install is done in a very similar way to installing WordPress in a domain root. We just install to a different folder.

First thing is to create the subdirectory. Inside cpanel, open the File Manager.

Open the root folder of the website where you want to add the subdirectory install. Inside that folder create a new folder that is the name of the subdirectory you want.

For example, if you wanted a new site at

The folder you make needs to be called members.

Your subdirectory has been created. It’s that easy.

That is where we’ll upload fresh WordPress files in a few minutes.

But first, we’re going to create the database.

To do this, go back to your cPanel and open the MySQL databases page. Enter a name for a new database and create it. Make note of the database name because we’ll need in a minute.

Next, and on that same page, create a new user and give them a unique password or use the password generator.

Make note of the username and the password.

Now scroll to the bottom of the MySQL database page and link to the user to the database and give them all privileges.

The database is now created and ready.

Now we’ll upload new WordPress files.

Go to and download the latest WordPress installation package to your computer.

Next, log into the File Manager in hosting account and open the root of your website. Inside that root folder should be a folder with the same name as you chose for you subdirectory. Open that folder.

It should be empty.

Now, click on the Upload link in the menu system. It will open a new window or a new tab. Click the button to open the file browser and choose the WordPress files you just downloaded.

It should complete very quickly. Once complete, you can close the upload window/tab.

Now hit Reload in the File Manager. A zip file should appear. Click it to highlight it and then click on Extract in the top menu.

Click on Ok on the dialog box that pops up to begin extraction.

Click on Reload again so you can see all the files.

Click on the wp-config.php file and then click on Code Editor to open that file in the editor.

Find the section where the database credentials go and copy the info from your database in there. Click on Save Changes when you’re done.

Now, open your subdirectory in a new browser tab or window. You should be presented with the familiar WordPress installation screen.

Install WordPress as normal.

Once installed you can log in and now you have a WordPress site in a subdirectory. Pretty sweet!

I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.


If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.

Klicken Sie auf den unteren Button, um den Inhalt von zu laden.

Inhalt laden

Connect with us:

WP Learning Lab Channel:



Google Plus:


WordPress Tutorials – WPLearningLab



  1. Hi There, I have issue with my wordpress site…I have access to admin dashboard but the Work area is white blank..but i can see the the Main you know how to fix this?

  2. Hi, I have installed WP in root folder, Let's say with URL And I have installed another in subdirectory with URL In both these directories I have posts. Whenever I create a post in, the post URL will be like Now I want to hide this subdirectory name "sub1" only from the post URL. Which can be done by adding the sudirectory name in .htaccess file present in the root folder. In the mean time I also want to access the home URL of subdirectory Please suggest

  3. I have created a subdirectory. And I have two wordpress installed, one in root and the other in subdirectory. Both of them contains posts and pages. I want to access both and it's happening. But when I am hiding the subdirectory slug from the post URL by modifying the .htaccess file, the sub directory name got hidden as per the requirement but the posts of my main domain is inaccessible and getting 404 error. I want to access the post from both root as well as subdirectory. Please suggest.

  4. Hello, I have the wordpress website with posts already existing on it. I want and planning to create a subdirectory and install wordpress in it; However, I still want to use the same theme and keep the same posts I already have on my current worpress website (I want to keep the same content because I will make some very few changes and I am planning to add a specific geographic location to the subdirectory site created via google search console).
    How could I keep the same content (than my current worpress website), features, posts, and design in the new subdirectory worpress site I will create? Thanks for your help!

  5. Hi WP Learning Lab,
    I have an existing site The root site and pages are html files. WP is installed in a folder named projects (
    I wish to ensure that WP remains in this projects folder. The WP should now control whole site. The should now be the blog (index) page whilst all other pages including the home page are controlled by WP.
    I have tried several steps including changing permalink settings, general settings in wp, wp-config.php, .htaccess to no avail.
    How can I do this?

  6. Your video is quite helpful for learning. Good job man!

    Just a question, what's your suggestion to create a multi-language based website? What will be better – Subdirectory or Subdomain?

  7. It helps a lot and solved my problem, thanks

  8. Great video, thank you!

  9. Thank you very much your video helps a lot. I have a quick question, at 6:58 when I install wordpress, for the email, do I use a new email if im doing this for my client? or do I use my client's ?

  10. Awesome, thank you!

  11. What if your host already has a WP installer?

  12. Awesome

  13. its showing me 404 error why??

  14. Um Amazing.

  15. Thanks for the tutorial! I followed the steps and everything seemed to go well.. but when I try to access the new URL, it says 'The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. Try installing' (if I click on try installing it says, WP is already installed and I can use my new credentials to login yo the dashboard). What am I doing wrong?

  16. hi sir i have one doubt i can add directly sub directory through wp dashboard what is the difference to do like this ??

  17. You are so Awesome

  18. I want to use the subfolder to build a new site without taking my main site down when I finish can I transfer the subfolder to the original domain

  19. Hey, is it possible to configure or connect the main and sub-folder domains to use the same clients' login credentials and have accept to both contents regardless of where the client login?

  20. Excellent.. Perfect… made work for me… I'm learning every day more… Thanks a million..

  21. This is one of the best tutorials I have ever watched. Cool. I just had to subscribe 😉

  22. Any reason why you would not do this via the WordPress Multisite way? That way you can access any number of subdomain or subdirectory sites, from just one login.

  23. i have website with 2 other subdirectories, but when i try to view the one I created new web (in wordpress), it redirects to the main website, but there is another subdirectory website that does not redirects, it opens up easily, sample websites name only not the actual-> ( = is the main, = it opens up without any redirection to the main, = it redirects to the main, i tried to make another one, with another name it still redirects to the main!) can you or someone help me on this? thanks a lot!! (note: i am not the original web designer of that page, i only maintain it, another person made it which i do not have any contact anymore, thanks again!)

  24. Short, straight to the point and very explanatory. Awesome stuff right here. Thanks for this

  25. I literally followed each step perfectly but I keep getting the error establishing connection. Ugh. 🙁

  26. i followed the exact steps , but when i go to for ex : myoldsite/newWordPress i still get the 404 file or directory not found .

  27. Is it necessary to install wordpress in every subdirectory?

  28. Hi, do you have a tutorial of a subdomain? I have made a multisite WordPress site. But when I added it to WordPress it tells me SSL DNS error.

  29. First time installing wp. Easiest thing i've done after following this video! great job.

  30. u sir are awesome THANK YOU… if all tutorials were like this the internet as whole would be a better place lol…KEEP DOIN WHAT U DO…

  31. Thanks a lot for your great video!

Comments are closed.