Beginner's Guide for WordPress / Start your WordPress Blog in minutes

Beginner’s Guide to WordPress File and Directory Structure

Do you want to learn about WordPress file and directory structure? The core WordPress software, themes, plugins, and user uploads are all stored on your website. In this beginner’s guide, we will explain the WordPress file and directory structure.

WordPress files and directory structure

Why You Should Learn About WordPress File and Directory Structure?

Most users can run their WordPress site without ever learning about WordPress files or directories. However, understanding how WordPress stores files and directories can help you solve many common WordPress problems on your own.

This guide will help you:

  • Learn which WordPress files and folders are core files.
  • Understand how WordPress stores your images and media uploads.
  • Where WordPress stores your themes and plugins.
  • Where configuration files are stored on your WordPress install.

This information also helps you learn which WordPress files should you backup.

You will also be able to perform troubleshooting tasks like deactivating all WordPress plugins, switching to a default theme, or fix other common WordPress errors.

Having said that, let’s take a look at WordPress file and directory structure.

Accessing WordPress Files and Directories

First, you will need a FTP client to connect to your WordPress server. See our guide on how to use FTP to upload WordPress files for detailed instructions.

An easier alternative to FTP is File Manager. It is a web based application that comes built into cPanel dashboard of your WordPress hosting account.

Once you have connected to your WordPress site either using FTP or File Manager, you will see a file and directory structure that looks like this:

Core WordPress files and folders

Files and folders in the red squares are the core WordPress files. These are the files and folders that run your WordPress site. You are not supposed to edit those files on your own.

Here is a list of core WordPress files and folders you would see in your WordPress site’s root directory.

  • [dir] wp-admin
  • [dir] wp-includes
  • index.php
  • license.txt
  • readme.html
  • wp-activate.php
  • wp-blog-header.php
  • wp-comments-post.php
  • wp-config-sample.php
  • wp-cron.php
  • wp-links-opml.php
  • wp-load.php
  • wp-login.php
  • wp-mail.php
  • wp-settings.php
  • wp-signup.php
  • wp-trackback.php
  • xmlrpc.php

WordPress Configuration Files

Your WordPress root directory contains some special configuration files. These files contain important settings specific to your WordPress site.

WordPress configuration files

  • .htaccess – A server configuration file, WordPress uses it to manage permalinks and redirects.
  • wp-config.php – This file tells WordPress how to connect to your database. It also sets some global settings for your WordPress site.
  • index.php – The index file basically loads and initializes all your WordPress files when a page is requested by a user.

You may need to edit wp-config.php or .htaccess file sometimes. Be extra careful when editing these two files. A slight mistake can make your site inaccessible. When editing these two files, always create backup copies on your computer before making any changes.

If you don’t see .htaccess file in your root directory, then checkout our guide on why you can’t find .htaccess file in your WordPress root directory.

Depending on how your WordPress site is setup, you may or may not have the following files in your root directory.

  • robots.txt – Contains instructions for search engines crawlers
  • Favicon.ico – A favicon file is sometimes generated by WordPress hosts.

Inside wp-content Folder

WordPress stores all uploads, plugins, and themes in wp-content folder.

wp-content folder in the root directory of a WordPress site

It is generally assumed that you can edit files and folders inside wp-content folder. However, this is not entirely true.

Let’s take a look inside wp-content folder to understand how it works and what you can do here.

Inside wp-content folder of a typical WordPress blog

The contents of wp-content folder may differ from one WordPress site to another. But all WordPress sites usually have these:

  • [dir] themes
  • [dir] plugins
  • [dir] uploads
  • index.php

WordPress stores your theme files in /wp-content/themes/ folder. You can edit a theme file, but it is generally not recommended. As soon as you update your theme to a newer version, your changes will be overwritten during the update.

This is why it is recommended to create a child theme for WordPress theme customization.

All WordPress plugins you download and install on your site are stored in /wp-content/plugins/ folder. You are not supposed to edit plugin files directly, unless you wrote the plugin just for your own WordPress site.

In many WordPress tutorials, you will see code snippets that you can add to your WordPress site. The best way to add custom code to your WordPress site is by adding it to functions.php file of your child theme or by creating a site-specific plugin.

WordPress stores all your image and media uploads in the /wp-content/uploads/ folder. By default, uploads are organized in /year/month/ folders. Whenever you are creating a WordPress backup, you should include uploads folder.

You can download fresh copies of WordPress core, your theme, and installed plugins from their sources. But if you lose your uploads folder, then it would be very hard to restore it without a backup.

Some other default folders you may see in your wp-content directory.

Many WordPress plugins may also create their own folders inside your wp-content folder. For example, in the screenshot above we have a gallery folder created by Envira Gallery plugin.

Some of these folders may contain important files. Like the gallery folder may contain your gallery images. You should always backup such folders to avoid losing important data.

Other folders may contain files that you can safely delete. For example your caching plugins like W3 Total Cache or WP Super Cache may store cached files in their own folders.

That’s all, we hope this article helped you understand WordPress file and directory structure. You may also want to see our beginner’s guide to WordPress database management with phpMyAdmin.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

53 CommentsLeave a Reply

  1. Thanks for sharing this information. This will help a lot during troubleshooting and website backup n restore.

  2. Please help me on how can I create a folder inside my blog hoste on wordpress on my site. I want to create more subfolder under that like news, life etc to make sure my users get the content more organized?

  3. Getting this error: Fatal error: Call to undefined function wp() in XXXX\html\wp-blog-header.php on line 12. Tried several troubleshooting, but wont solve the issue. Stoped Theme, and pluggins.

  4. Hi
    Im getting the error message about a missing ads.txt file, i know where to find it, but im not sure where i have to insert it.

    Best regards
    Bruno
    Denmark

  5. Am trying to upload an unzipped file to this location:

    wp-content/uploads/GeoLite2-Country.mmdb

    Question : How do I find the location and how do i upload the unzipped file to this location.

    • The closest to what it sounds like you’re wanting is under wp-content>Uploads

      Admin

  6. Hi
    My website was hacked. it keeps redirecting me to a spammy site. I can’t log in via the backend (cos it keeps redirecting me to a spammy site) and I don’t have a backup of the site but I can still access my Cpanel but dont know what to do there, please any help will be appreciated.
    hemjaypost.com is the site

  7. Crazy question.
    After importing demo site content on an Avada themed site – there are so many pages I have NO IDEA how to get back to identify and edit my home page in the PAGES link? I now have 8 pages of “pages”. How can I find my Home page? BTW – In READINGS > SETTINGS – I’ve checked blog assigned to home page NOT to a STATIC Page. Many thanks!
    I have googled several ways – but can’t figure out this thing!

    • Hi Karen,

      When you go to Pages » All Pages you should be able to see — Homepage label next to the page used as your homepage. You can also try reaching out to the theme developer for support.

      Admin

  8. I, too, want to find where my old .htm files that are now encased in WordPress with different urls! I need to delete a bad xml file and I have to idea how to go to server and remove. I removed it permanently inside the page list, but I am afraid Bing is still thinking that is what I want submitted. It keeps saying it is not valid and I want to clear it out!
    Thank you!

  9. hi
    i developed an custom post in woocommerce website. But after that i want to use an dynamic photo slider in this custom post, i tried a lot but failed to make it dynamic.please guide me about the use of page template and how to make slider dynamic.

  10. Helpfull but i want edit a page outside without WordPress , by another html editer ,becouse i try to remove theme on some specific pages ,but not entier website

  11. thank you, that was very helpful… but i want to know if it is safe to replace all the wordpress core files by a new files?

  12. Hi there, I recently downloaded my old WordPress site onto my computer, and installed a new site on my domain. I am now trying to dig around and find all my blog posts from the old site so I can add them to the new site, any idea if thats possible and where I would find those? Thanks so much for your help.

  13. what is the file name for the users in the wordpress? I have a complete backup for my site, moved it to another server, the number of the users were about 24K but now I found only 9K and I would like to restore the old one. Thanks in advance for your reply. Hany Danial

  14. Hi,

    Suppose if I want to change the look of the WordPress theme then which files are important or in which file do I need to change the code?

    Since last 2 years I am thinking to change the some little look of my theme but because of not fully understanding I couldn’t do it.

    Thanks,
    Amit

  15. Hi, thank you for this post I agree with you that An easier alternative to FTP is File Manager. It is a web-based application that comes built into cPanel dashboard of your WordPress hosting account. very useful information

  16. how to i change upload the pictures for the web site or upload the new coupon for the website that use WordPress or edit the content of the website?

    when I login to the FTP site, i see these 3 folders
    wp-admin
    wp-content
    wp-includes

    thanks
    john

      • thanks. the company who wrote the website did not transition to me. How do I request to reset the password to login to the admin page?

        also, i need to update just the coupons by update the new images of the coupons.

        also, how to i transfer the page_id=369 to the coupons page

        thanks again,
        John

  17. great article. But I have a question though. I am a beginner and trying to design a website via wordpress. i have finished the design to an extent. but my problem is that when i try to upload my wordpress file via ftp (file zilla), i cant seem to find the file on my C:/. how to i locate my wordpress file? thank you as i await your response

  18. It is really helpful for me as I am just starting out with my blog and I have very little knowledge about these technical issues. Great content, thanks.

  19. Great article! I do have a question though: Where do we actually find the articles that we wrote on the site? Let say I write an article on my site. This article is normally stored in wordpress files. where can I find it?
    Thanks

    • Your article itself will not be stored in files, it will be stored in the database. Only your files will be stored inside the wp-content/uploads.

      Ok? :)

  20. please i need your help urgently, i want to restart my afresh. But i just need my articles and its images. i do not need anything else.The reason for this is that my hosting is saying someone is using my site to spam people using a business address i did not even add to my webmail. if i delete it they create another one. but now another issue is thta malware are been detected on the site. but i am using the newspaper theme so i do not know why all this issues. I can do all the installing of new wordpress and every other thing but i need to just put the contents i have on the new site i am going to create. i still have my old site on now and i have the backup in my file manager home directory.

  21. Thanks for the article….what about finding “pages” on the directory? i cant seem to find them…will they be accessible via cpanel or just in the wp interface? i see all the image files i uploaded on the [dir]uploads page, organized by month/year as you mentioned on the cpanel directory, but was wondering where i can find the actual Pages file/word content pages? thank you…

      • So, there’s no way to get the contents of the page themselves through the FTP? Like, if I wanted to pull my about page from the FTP, I wouldn’t be able to do that?

        • Or… is this databased stored elsewhere on the site outside of the wordpress folder, and having only backed up the wordpress folder when my site was deleted, I’ve lost all of my content?

        • No, you will not be able to do that.

          WordPress does not create and store static pages. Instead, it stores your content in a database and then generates HTML pages on the fly.

        • “No, you will not be able to do that.

          WordPress does not create and store static pages. Instead,
          it stores your content in a database and then generates
          HTML pages on the fly.”

          After a WSOD and several hours of trying to get back to the dashboard, I deleted all WP files from my file mgr. Before I did that I backed up and stored all of those files in a temp file in file manager.

          Is there a way I can get my input (static pages) generated in html, so I may copy them?

          I am about ready to install another WP theme, but before I do so I hold a slim hope that these pages are still stored somewhere, like in an etheral world of some database.

        • Robert, I second your motion. The answer has been rather expertly skirted around here. Is there some kind of membership fee we need to pay for these kind of seemingly simple answers? All I can find is the import/export tool for the pages, then edit the CSS or delete the unnecessary pages as desired.

  22. Nice article. For development team working with enterprise content management services like WordPress (or in that matter any other CMS like Sitefinity, Drupal, etc.) must understand the basic file structure. This will not only help them find the files but with this they will also be able to organize the files in proper way.
    Using a nested approach to save your content and system files is a the best way to design a file structure.

  23. Thank You so much. It was Really Helpful for me. I work in my University Webteam and have made a website for them :)

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.