Always Install WordPress on The Root Directory – A Guide to Understanding and Managing WP

by Daniel in 46 Comments — Updated Reading Time: 10 minutes

Background Image

Unless your blog is a secondary part of an existing website you should always install WordPress on the root directory. When I created my first blog I used an automatic WordPress installation that my web hosting company offered, but the standard installation was done on “www.domain.com/blog.

I was not sure how this would affect the blog therefore I decided to leave things as they were. A couple of months later when I started studying SEO I realized that this was a bad move. My blog could be accessed either through “www.domain.com” or “www.domain.com/blog”, meaning that the Homepage was duplicated. At the time, I didn’t know how to do proper 301 redirect. This is my contribution to the “Blogging Mistakes” project. We already have 21 people participating, if you have not submitted your entry make sure you do so. The deadline is the midnight of Sunday. I am looking forward to reading your blogging mistakes!

Understanding the WordPress File System

Firstly, it’s important to get to grips with the overall structure of WordPress. Just like how your computer has a file system that organizes and stores your data, WordPress has its own system too. At its core, WordPress uses a simple yet effective file system. When you install WordPress, it creates a set of files and directories on your server. Think of it like moving into a new house and organizing all your stuff in specific rooms for easy access. That’s essentially what WordPress does – it organizes its files in a similar manner.

Understanding this file system is crucial when you install WordPress. It not only helps you navigate and manage your site more effectively but also aids in troubleshooting. It’s like understanding the blueprint of a house – if something goes wrong, you know exactly where to look!

A Peek into the WordPress File Structure

Now, let’s unzip the WordPress installation file and see what’s inside. The main WordPress folders you’ll find are:

  1. wp-admin: This is where all the magic happens! The wp-admin directory contains files for the WordPress administrative back end, basically everything that makes your WordPress dashboard function.
  2. wp-content: Ever wondered where your themes, plugins, and media uploads reside? Yep, you guessed it! The wp-content directory is the one-stop destination for all these elements. It’s the most frequently accessed folder when you install WordPress because it houses your website’s personal touches.Whether you’re a seasoned developer or a WordPress newbie, familiarizing yourself with the WordPress file system will make your life easier. Let’s take a scenario: you need to install a custom theme. To do this, you’ll need to upload your theme to the wp-content/themes directory. Without understanding the file structure, this could seem like finding a needle in a haystack!Now, imagine you’re facing some unexpected issues after installing a plugin. The first place to check? The wp-content/plugins directory! Knowing where everything is stored allows you to diagnose and rectify issues with greater ease and speed.
  3. wp-includes: This directory is like the engine room of the WordPress ship. It contains files that your site needs to function properly, like files for database operations, core functionalities, etc.

Then there are a handful of PHP files, like wp-config.php, which holds vital information about your site’s database, and .htaccess, which allows you to override certain server configuration settings.Free Macbook Pro Showing Text Stock Photo

Comparing WordPress to Other CMS

Diving into the world of Content Management Systems (CMS), one cannot overlook the giant in the room: WordPress. However, it’s not the only player in the game. Let’s compare WordPress to other popular CMS platforms and see how they stack up.

WordPress vs Joomla

Starting with Joomla, another open-source CMS platform, there are some key differences to note. While WordPress shines in its user-friendliness and massive theme and plugin directories, Joomla offers more advanced user management features. If you need to manage multiple user permissions and have some technical skills, Joomla could be an interesting choice. However, WordPress, with its widespread community support and ease of use, often comes out on top for many users.

WordPress vs Drupal

Drupal, another contender in the open-source CMS arena, is known for its robust security and scalability. It’s a preferred choice for large, complex websites that require custom data organization. However, Drupal requires a higher learning curve compared to WordPress. So, while WordPress might not offer the advanced security features of Drupal out-of-the-box, its simplicity and flexibility make it a go-to for a wide range of website projects.

WordPress vs Wix

Shifting gears to a hosted platform, Wix is a popular choice for users looking for drag-and-drop website builders. It’s easy to use, no doubt, but its customization options can’t compete with WordPress. Also, with WordPress, you truly own your website, while with Wix, you’re essentially “renting” your web space. If you value ownership and extensive customization options, WordPress still wins the race.

WordPress vs Squarespace

Squarespace, another hosted platform, is known for its visually stunning templates, making it a favorite among creatives. However, Squarespace falls short when it comes to the level of flexibility and control offered by WordPress. With WordPress, you’re not tied down to a specific hosting provider and have the freedom to customize your site endlessly.

WordPress vs Blogger

Blogger, powered by Google, is a free blogging platform that’s been around for a while. It’s simple to use, but it’s limited in terms of design and functionality. WordPress, on the other hand, offers the versatility to create anything from a personal blog to a full-fledged eCommerce store.

While each CMS has its strengths, WordPress stands out due to its balance of user-friendliness, flexibility, and control. Regardless of your technical skill level, WordPress provides the tools and resources to create a website that meets your unique needs.

Remember, choosing a CMS should be based on your specific needs, skills, and long-term plans. WordPress is an all-rounder that has proven itself over the years, but the others have their niches where they excel. Make an informed decision, and you’ll have a strong foundation to build your website on.

Here is a quick comparison

Platform
Strengths
Weaknesses
WordPress
Highly user-friendly, huge theme and plugin directory, extensive customization options, large community support.
Might require plugins for advanced security features.
Joomla
Advanced user management features, decent extension and template availability.
Less intuitive for beginners, fewer themes and plugins compared to WordPress.
Drupal
Robust security features, ideal for complex, large-scale websites with custom data organization.
Higher learning curve, less beginner-friendly.
Wix
Easy-to-use drag-and-drop website builder, managed hosting.
Limited customization options, less control over your website as compared to WordPress.
Squarespace
Beautifully designed templates, good for simple websites, managed hosting.
Limited flexibility and control, tied to a specific hosting provider.
Blogger
Simple to use, free platform powered by Google.
Limited in design and functionality, not suitable for large, complex sites.

Installing and Reinstalling WordPress

Are you ready to install WordPress? Let’s get started!

Delving into the practical aspect of WordPress management, let’s navigate through the process of how to install WordPress in the root directory. This is a common scenario that users come across, so if you’ve been wondering about this, you’re not alone.Turned-On Monitor

Prepping for Installation

Before installing WordPress, ensure that your hosting environment meets the WordPress requirements, which include a MySQL database and PHP support. Typically, most hosting providers are equipped to handle WordPress installations. You’ll also need a domain name pointed towards your hosting account.

Installing in the root directory makes sense for a single website, while a subdirectory only makes sense if you’re running multiple sites from one domain.

Let’s break down the steps to install WordPress in the root directory. Here we go!

  • Step 1: Download WordPress
    Head over to WordPress.org and download the latest version of WordPress. The downloaded file will be a .zip file.
  • Step 2: Extract the WordPress .zip File
    Once the download is complete, you’ll need to extract the zip file. This should reveal a folder named ‘WordPress’ containing all the WordPress core files.
  • Step 3: Connect to Your Hosting Account
    You’ll need to connect to your hosting account using an FTP client like FileZilla. You’ll need your FTP login credentials, which your hosting provider can provide.
  • Step 4: Navigate to the Root Directory
    In your FTP client, navigate to the root directory of your site. The root directory is usually named ‘public_html’, but it could be different depending on your hosting provider.
  • Step 5: Upload WordPress Files to the Root Directory
    Here’s the crux of the process. Take all the files you extracted from the WordPress zip file and upload them into your root directory.
  • Step 6: Create a MySQL Database
    While the files are being uploaded, you can create a MySQL database for your WordPress site. Your hosting provider should offer a database creation tool like phpMyAdmin in your hosting control panel.
  • Step 7: Run the WordPress Installation Script
    Once the files have been uploaded and your database is ready, open a new browser window and navigate to your domain name. You should be greeted by the WordPress installation script. Follow the prompts, input your database information, and proceed with the installation.
  • Step 8: Complete the WordPress Installation
    As you finalize the installation, you’ll be asked to provide details like your site’s title, your desired username and password, and an email address. Fill these in, hit ‘Install WordPress’, and voila, you’ve successfully installed WordPress in the root directory!

Now that we’ve gone through the steps, it’s evident that installing WordPress in the root directory is not as intimidating as it might initially seem. With a bit of patience and some attention to detail, you’ll have your WordPress site up and running in no time. Remember, every great WordPress site starts with this fundamental process!

If you ever find yourself needing to reinstall WordPress – don’t panic! Whether it’s a tricky bug or a complete site overhaul, reinstallation can be done relatively painlessly. BlueHost, SiteGround and Hostinger have useful guides on how to do this.

Troubleshooting Common WordPress Issues

A dive into WordPress management would be incomplete without addressing some of the common directory issues that can emerge. Like any robust platform, WordPress has its quirks, and occasional issues with directories are part of the package. However, the beauty of WordPress lies in its solutions-oriented approach, and there are clear fixes to these problems.

WordPress Issue #1: .htaccess File Errors

The .htaccess file in your WordPress installation can sometimes be the culprit behind issues with permalinks and 404 errors. If you’re facing trouble with your URLs or are encountering frequent 404 errors, it’s wise to take a peek at the .htaccess file.

The simple fix here is to reset the permalinks in your WordPress dashboard. Go to ‘Settings’ -> ‘Permalinks’ and simply click ‘Save Changes’ without making any modifications. This action forces WordPress to generate a new .htaccess file, potentially resolving any issues.

WordPress Issue #2: WordPress Asking for FTP Credentials

Sometimes, when trying to install a theme or plugin, WordPress might prompt you for FTP credentials. This is typically due to WordPress not having the correct permissions to write to the wp-content directory.

To fix this, you may need to change the directory permissions. Using an FTP client, navigate to the wp-content directory and adjust the permissions to make it writable. You should consult with your hosting provider or a knowledgeable developer before changing permissions, as incorrect settings can pose security risks.

WordPress Issue #3: Unable to Create Directory

This error pops up when WordPress cannot upload images or create new folders within the wp-content/uploads directory. This issue is also usually tied to incorrect directory permissions.

You can rectify this by changing the permissions for the wp-content/uploads directory, similar to the solution for the previous issue. Again, always exercise caution and seek expert advice when adjusting directory permissions.

WordPress Issue #4: ‘Stylesheet is Missing’ Error

This problem occurs when WordPress cannot locate the style.css file in your theme’s directory, causing the theme to malfunction. This issue commonly happens when a theme has been incorrectly installed or uploaded.

To solve this, ensure that you’re uploading the correct .zip file for your theme, which should directly contain the style.css file. Sometimes, the downloaded theme package might contain additional folders or files, and the actual theme might be nested within. Always check the theme’s documentation for proper installation instructions.

Navigating WordPress directory issues may seem daunting, but as we’ve seen, they’re typically manageable with a bit of knowledge and patience. The vast WordPress community is always there to help, with numerous resources and tutorials available to guide you through any challenges you encounter. Remember, troubleshooting is a natural part of the WordPress journey and a valuable learning experience in managing your site.

Absolutely! Let’s add this to the list.

WordPress Issue #5: Error Establishing a Database Connection

This is a common issue in WordPress that arises when WordPress is unable to connect to the database. This error could be due to several reasons, such as incorrect database credentials in your wp-config.php file, a corrupted database, or issues with your hosting server.

To troubleshoot this, start by checking your wp-config.php file, which is located in your WordPress root directory. This file contains your database login information, so make sure that the database name, username, password, and host are all correct.

If the wp-config.php file looks correct, the issue might be a corrupted database. You can check this by navigating to yourdomain.com/wp-admin. If you see a different error saying the database needs repair, then you can use WordPress’s built-in database repair feature. Add the following line to your wp-config.php file: define('WP_ALLOW_REPAIR', true);. Then, visit yourdomain.com/wp-admin/maint/repair.php and follow the instructions for repairing and optimizing your database. Remember to remove the line from your wp-config.php file once you’re done.

If neither of these solutions work, it’s time to contact your hosting provider. There might be an issue on their end, or they might be able to help identify the problem.

With this addition, you can see that WordPress directory and database issues are numerous, but the solutions are within reach. It’s all about understanding the problem and knowing where to look for answers. And remember, the WordPress community and your hosting provider are invaluable resources when you’re troubleshooting issues.

Here is a quick summary of common WordPress problems, along with their potential causes and solutions. If you have more to suggest, then please add them in the comments section below.

Problem
Possible Causes
Solutions
.htaccess File Errors
Corrupted .htaccess file.
Reset permalinks in WordPress dashboard.
WordPress Asking for FTP Credentials
Incorrect permissions on wp-content directory.
Change directory permissions via FTP client to make it writable.
Unable to Create Directory
Incorrect permissions on wp-content/uploads directory.
Adjust permissions for wp-content/uploads directory using FTP client.
‘Stylesheet is Missing’ Error
Incorrect theme installation.
Ensure correct .zip file for theme is uploaded. Check if style.css is in the correct location.
Error Establishing a Database Connection
Incorrect database credentials in wp-config.php, corrupted database, or server issues.
Check wp-config.php file for correct database information, use WordPress’s built-in database repair feature, or contact your hosting provider.
White Screen of Death
PHP or database errors, incompatible theme or plugins.
Increase PHP memory limit, disable all plugins and switch to default theme. If issue persists, enable debugging to identify the error.
Internal Server Error
Corrupted .htaccess file, PHP memory limit, problematic plugin or theme.
Check for .htaccess corruption, increase PHP memory limit, deactivate plugins, or switch to default theme.
Connection Timed Out
Insufficient shared hosting resources, plugins consuming too many resources.
Deactivate all plugins, switch to default theme, or consider upgrading hosting plan.
HTTP Error When Uploading Images
Incorrect file permissions, conflicting plugins, image size.
Check permissions for wp-content/uploads, try disabling plugins, or reduce image size.
Admin Dashboard Is Not Displaying Properly
Failed update, caching issue.
Clear browser cache, reinstall WordPress manually.

Always remember that for each problem encountered with WordPress, there are efficient and effective solutions readily available. The key is in understanding the issue and the possible causes, then applying the appropriate fix.

You’re now equipped with a wealth of knowledge about the WordPress root directory, from understanding its purpose to learning how to navigate it. You’re all set to install WordPress and begin your journey in managing your own website. Good luck!

Share this article

46 thoughts on “Always Install WordPress on The Root Directory – A Guide to Understanding and Managing WP”

  1. I have installed by blog on root directory, its a numerology blog, But now i am planning to enhance it with some additional features and a separate home page. How do i go about it? I cant change my blog url, as i ll lose my page rank. Can anyone help me

    Reply
  2. I made the same mistake, I originally made my site for something else but have since discovered having a blog is just the smart way to go so now everything goes through my blog.

    What I did was create a redirect that looks as if my Blog is loading it lasts a couple of seconds then loads my blog.

    Reply
  3. Am I missing something or does this not make any sense at all?
    If the same content is accessible from different addresses of your website then you need to set up a sitemap to identify which are your main pages. You could also set up a 301 wildcard redirect if it was a big problem.
    I am not convinced that you “should never” install a blog into a folder. Content can be accessed from different addresses regardless of whether it in a folder or not. It is not ideal and should be addressed on a case by case basis.

    Reply
  4. I am glad I found your blog with the interesting points about blog installs as I have been searching for the answer to “Where is the best place to install a WP blog-In the domain root or a sub directory/blog?”

    I have WP blogs in both root and /blog in the premise that if it is a new domain it goes into the root and if the domain has history and inbound back links then I put the blog into /blog with unique content and link to the original html pages from the content or from the Links sidebar.

    This was mindset until today when I installed a blog on an “aged” domain for the convenience of a quick install and setup while I revamped my html pages. (This was made easier as I had transferred 8 domains recently from my original web host here in Poland (No cPanel!) to a new host in the USA which has cPanel)

    The one advantage I can see is that installing a blog in /blog is if the domain is an existing commercial site that needs or wants to involve its visitors/customers on a blog with an opt-in that supports the main money site without disturbing their existing pages

    But now after reading all the comments here I am wondering if I am missing something too!

    I would really appreciate any comments on this approach…

    Reply
  5. You are all very much talking a bit techie and over my head. Could you be very specific with the instructions? Here is what I have:
    – blank sites registered with go-daddy that send over to my blog
    – a blog on blogger that is fairly new.
    I want to make sure I am doing this correctly.
    I use masking.
    I don’t use wordpress….plz tell me if I am making a mistake there too.
    thanks for the input and specifics.

    Reply
  6. Like Ray Fowler above, I too have set up my blog in a sub-folder, but point it back to the root…I know this is done a lot, and many blogs appear to do just fine with it…BUT

    It doesn’t appear to me that an actual 301 directive is in place, so I actually wonder why we don’t get penalized by the search engines for doing a kind of “masked re-direct.”

    Any thoughts?

    Reply
  7. Where you put the WP files on your server and what url your visitors type in to access your site are two completely separate things.

    If you’ve installed WP to a subdirectory but want urls that make it look like it’s in root, instead of reinstalling to root you should follow the instructions at

    Reply
  8. So I’m thinking of installing WordPress to my site, which will double as a Portfolio. My homepage, I’m planning on having a “featured works” section, as well as a section for recent blog posts (possibly just the title and a description of the post)

    Would this count as duplicate data? Or would I be safe?
    I’m not too sure about that …

    Reply
  9. Hmm, well amen to that! I installed under /blog and am now having to move everything to the root. Seems like quite an undertaking, and hate to lose my links, but better late than never!

    Reply
  10. Good idea to install WP in the root directory, is easy for your visitor and search engine to find your blog. It’s more “search engine friendly”

    To Your Success
    Bryan Hee

    Reply
  11. What about if I want to install forum/message board software in the future? I wouldn’t be able to do so if I installed WP to the root directory, right?

    Reply
  12. Thanks Daniel,

    I ‘ve been thinking for this situation for couple day and finally I find your web on google SERP that your tips get on page 1

    I had find a good resources to bookmark at your blogs.

    Nice for sharing

    Reply
  13. I realize I’m a month late, but maybe someone will take the time to respond. I’m just learning about blogs and I had a question:

    We intend to have a blog with several features:

    blog entries with videos, rss feeds, opt-in form, and a few static pages (about us, information, etc). Primarily it will be a blog site, but over time there may be other features added on.

    I have a host who allows free add-on domains so this will be technically not on the primary domain, but for all intensive purposes it will (it has it’s own separate domain).

    so my question is, do I install WordPress on the root level, or on a sub folder or on a sub domain. And to make things more complicated, I’d prefer to keep the WP main files in a subfolder of the main root folder so that it’s not cluttering that folder.

    any suggestions?

    Reply
  14. Hi Daniel!

    I would like to confirm whether the following scenario is fine or not:

    If I am managing two different blogs, each having their respective folders: “root/blog1/” & “root/blog2” and I have 2 different domain names pointing to the respective blog folders. Will that be fine for search engines? There is nothing else in the root folder.

    Thanks!

    Reply
  15. Daniel, thank you so much for this post. I knew something is not right, my site is not getting any attention from anywhere. Now I know why. In the beginning I’ve run my site thru W3 validation site. It pointed on adding additional “/” somewhere in the address. I don’t know these things, so I’ve asked someone to do it. He said “It’s not elegant”, but reluctantly succumbed in editing the code. Now I see there is a bigger problem. Thanks again.

    Reply
  16. So your problem was actually duplicate content, not the root URL of your blog. I dare to say you could install it in /whatever, put other content on / and you wouldn’t lose anything. Or just do a 301 from / to /whatever, still the same.

    Reply
  17. Ray, your WordPress files are installed on the subdirectory, but the blog address is set to the root, so you are fine.

    Reply
  18. Mario, I respect your opinion. However, if that was the case, how can you explain dozens of popular blogs that use WordPress?

    Some of those blogs (e.g., TechCrunch) make more than $100,000 monthly in revenues, and I bet they pay a lot to programmers and web developers as well, just to make sure everything works. They are just paying stupid people?

    Reply
  19. This is an idiot advice. Not because of the root path argument, but because of the implicit recommendation of WordPress.

    That’s definitely the most bug-riddled software in existence. It even surpassed phpBB and PhpNuke security-wise. Everyone who installs that, deserves to get hijacked and content-cleansed.
    I have lost a lot of time to other douchebags on my shared hosting servers, because of that software. And mind you, WordPresses’ amateur programmers always shrug it off with ohh-it’s-not-thaaaat-a-big-a-security-risk or the NO WARRANTY GPL preamble.

    So, people – get ANY blogging software; just not WordPress!

    (check out FlatPress, S9Y or WikyBlog)

    Reply
  20. John, if you install WP on a subfolder like /blog/, all the posts’ URL will have /blog/ on it.

    Therefore if you disallow /blog/ you will be disallowing pretty much everything except the homepage :).

    Reply
  21. I made the same mistake when I started my wordpress site a few years ago. I had the domain name for a while and had previously hosted it on blogger and LJ. Then I moved to WP, which I adore and tell everyone about. But when I step up my WP, I did so at megorious.com/blog. The idea being to one day have something snazzy set up in my root. But that day never came. I found myself redirecting my root URL to /blog.

    After a year or so, I decided to move it all to the root, and for anyone who has done this with WP, you know how much of a pain it can be. I panicked so many times, thinking I had lost the entire thing. Thankfully, several hours later, I stopped crying…

    This is my first visit to your site. I have one suggestion (and please take this with a grain of salt). When I came to comment, I noticed you had a lot of comments I had to scroll through. This doesn’t phase me but for a lot of people it might. A simple link at the end of your post that directs them to the comment box would be nice.

    Just a thought…

    Reply
  22. Can someone explain how you install wordpress on the root directory? I’m totally new to this and have not yet set one up but want to make sure I’m doing it correctly. Is there an option that says “root directory” when you go to wordpress to set it up? Thanks.

    Reply
  23. I haven’t read through all the comments yet, but I’ve seen a few that suggest that if you use the automatic install of WP that is usually packaged with cpanel, you can’t install in the root directory. Actually, you can install in the root directory. The only time there would be a problem is if there is already a blog installed there, specifically a copy of WordPress, but that would be a problem if you did the manual install as well. Just my 0.02.

    Reply
  24. Ashish, as long as your homepage page has different content than the blog on a subdirectory is OK. Sites like SEOMoz have some content on the homepage and the blog on a subdirectory.

    The problem is that my blog was the only thing I had on the site, in that case you should place it in the root directory for optimal results.

    Doing a redirect like you did is a good solution also. Just make sure its a 301 else you will lose PR.

    Reply
  25. One more thing I forgot to mention.I have see lot of sites which are in subdirectory and they do well…..Putting in root directory might give you a benift but thats not the necessity

    Reply
  26. Well then I am taking up the challenge of having my blog in a subdirectory and make it successful.I dont agree with this concept to 100%.It might affect you a little but not to an extent that you are just dead.

    Till the time you are linked, indexed and good in books of google you have the benefit.

    Lets see how my blog does.

    Reply
  27. Ronald, I dont think it applies to subdomains because you can separate the submain from the root. Just make sure that the main domain has unique content.

    Reply
  28. I’ve seen this a few times recently and I’m glad I didn’t make this mistake.

    Your blog has been a great help to me and I hope you’ll do more group writing projects in the future. Thanks!

    Reply
  29. Since I have one WordPress adress and another website adress stated in the Options page this hasn’t been an issue to me even if I have the WordPress installation in another folder. My permalinks doesn’t write out the subfolder, so I guess I’m okay? Or did I miss anything?

    Another thing though, is to choose to have either www or no www, I just fixed that with a 301 redirect. I should have done this a long time ago…

    Reply
  30. I realized my mistake about six months or so in, so it was too late in my eyes to switch. It’s way too late now, which is a shame. To add insult to injury, I have the date in my permalinks, which bothers me every time I look at them!

    Reply
  31. Thilak, that is an idea I had for sometime hehe, there is no equivalent of the SEO Book for blogs yet :). It sure would take a lot of time to come up with something well structured, lets see in the near future!

    Reply
  32. That is certainly true, I’ve seen lots of bloggers do this mistake.

    I think, you show write a book and sell it. Nobody realizes these crucial mistakes when the just start blogging

    Reply
  33. When I installed WordPress a few months ago to start Randomn3ss.com, it was tempting to use the auto-installer my host has in cpanel, however I wanted it to be in the root directory. Every reason above is why I did it, as well as it being easier for my readers to find the site.

    Reply
  34. So, How would you fix that problem? Would you delete all the folders on the server and reinstall wordpress using the non-automatic copy? Or, Just move wordpress out of its’ ‘blog’ folder? I’m in the process of setting up a new blog on a different host and would like to know.

    Reply
  35. Mark, I think so. I know you can preserve Pagerank and incoming links as far as search engines are concerned, but Technorati seems to have a more obsolete ranking mechanism.

    Reply

Leave a Comment