WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Beginners Guide» Beginner’s Guide to WordPress File and Directory Structure

Beginner’s Guide to WordPress File and Directory Structure

Last updated on April 19th, 2016 by Editorial Staff
261 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
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.

  • languages – WordPress stores language files for non-english WordPress sites in this folder.
  • upgrade – This is a temporary folder created by WordPress during upgrade to a newer version

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.

261 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

51 Comments

Leave a Reply
  1. Fawwad says:
    Sep 30, 2020 at 3:01 am

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

    Reply
    • WPBeginner Support says:
      Sep 30, 2020 at 10:26 am

      You’re welcome, glad you found our guide helpful :)

      Reply
  2. Amit Maheshwari says:
    Sep 24, 2020 at 5:12 pm

    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?

    Reply
    • WPBeginner Support says:
      Sep 25, 2020 at 9:36 am

      It sounds like you want to create categories, you would want to take a look at our explanation on them below:

      https://www.wpbeginner.com/glossary/category/

      Reply
  3. Ron says:
    Feb 26, 2020 at 3:21 pm

    Great article. Where do the actual blog and posts end up?

    Reply
    • WPBeginner Support says:
      Feb 27, 2020 at 8:46 am

      Those would be stored in your database and not as a WordPress file :)

      Reply
  4. Kosovi says:
    Sep 26, 2019 at 3:53 am

    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.

    Reply
    • WPBeginner Support says:
      Sep 26, 2019 at 10:51 am

      You may want to try updating your files using method 2 from our article here: https://www.wpbeginner.com/beginners-guide/ultimate-guide-to-upgrade-wordpress-for-beginners-infograph/

      Reply
  5. Bruno rasmussen says:
    Aug 10, 2019 at 1:52 am

    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

    Reply
    • WPBeginner Support says:
      Aug 12, 2019 at 10:41 am

      You would insert it where your WordPress files are located, where you can see the wp-admin and wp-content folders or you could take a look at our guide here: https://www.wpbeginner.com/plugins/how-to-create-and-manage-ads-txt-files-in-wordpress/

      Reply
  6. J.Hameed says:
    Apr 28, 2019 at 5:45 pm

    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.

    Reply
    • WPBeginner Support says:
      Apr 29, 2019 at 1:28 pm

      You would use an FTP or a file manager if your hosting provider offers one and go into the folders wp-content then your uploads folder:
      https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/

      Reply
  7. Atalia says:
    Mar 4, 2019 at 7:44 am

    Hi
    Is there a “download” folder in wordpress and where is it located?

    Reply
    • WPBeginner Support says:
      Mar 4, 2019 at 1:54 pm

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

      Reply
  8. John says:
    Dec 29, 2018 at 7:04 am

    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

    Reply
    • WPBeginner Support says:
      Dec 31, 2018 at 3:16 pm

      You would want to go through the steps in our article: https://www.wpbeginner.com/beginners-guide/beginners-step-step-guide-fixing-hacked-wordpress-site/

      Reply
  9. Karen says:
    May 20, 2018 at 12:28 pm

    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!

    Reply
    • WPBeginner Support says:
      May 21, 2018 at 3:57 pm

      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.

      Reply
  10. Mary Emerson says:
    Apr 4, 2018 at 7:34 pm

    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!

    Reply
  11. Lalit Kumar Yadav says:
    Oct 9, 2017 at 3:35 pm

    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.

    Reply
  12. Monika Bhasin says:
    Aug 21, 2017 at 3:37 pm

    Thanks for that article

    Reply
  13. Archie says:
    Aug 19, 2017 at 5:28 pm

    I just started learning PHP and WordPress. This information is very helpful.

    Reply
  14. Ajju says:
    Jul 15, 2017 at 1:09 pm

    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

    Reply
  15. JohnLeyo says:
    Apr 16, 2017 at 6:52 am

    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?

    Reply
  16. Ben says:
    Apr 5, 2017 at 8:30 am

    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.

    Reply
    • Windigo says:
      Apr 14, 2017 at 4:25 am

      Your posts are stored in the database, you won’t find them in your wordpress folders.

      Reply
  17. Hany Danial says:
    Mar 9, 2017 at 11:52 pm

    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

    Reply
  18. Amit says:
    Feb 23, 2017 at 8:48 am

    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

    Reply
    • WPBeginner Support says:
      Feb 23, 2017 at 10:46 pm

      Hey Amit,

      Check out our guide on how to find which files to edit in WordPress theme.

      Reply
  19. tushar says:
    Jan 18, 2017 at 11:39 pm

    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

    Reply
  20. john says:
    Jan 18, 2017 at 1:27 pm

    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

    Reply
    • WPBeginner Support says:
      Jan 18, 2017 at 10:19 pm

      Hi John,

      You do not need to use FTP to make changes to your WordPress site. You can login to the admin area of your WordPress site and then go to Media to edit or upload images.

      Reply
      • john says:
        Jan 20, 2017 at 11:57 am

        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

        Reply
        • WPBeginner Support says:
          Jan 20, 2017 at 3:27 pm

          Hey John,

          You can ask your WordPress hosting company to reset password for you. You can also try our guide on how to add an admin WordPress user using FTP. However, please note that this is an advanced tutorial and if something goes wrong your entire website could become inaccessible.

  21. Ezeudo Emmanuel says:
    Dec 21, 2016 at 9:06 am

    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

    Reply
  22. KAIZER MD AMIN says:
    Nov 25, 2016 at 2:28 am

    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.

    Reply
    • WPBeginner Support says:
      Nov 25, 2016 at 8:06 pm

      Hi Kaizer,

      We are glad you found it helpful. Don’t forget to join us on Twitter for more WordPress tips and tutorials.

      Reply
  23. fassaha says:
    Oct 23, 2016 at 11:28 am

    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

    Reply
    • Henric Åkesson says:
      Nov 17, 2016 at 4:43 pm

      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? :)

      Reply
  24. ademola says:
    Oct 17, 2016 at 3:15 am

    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.

    Reply
  25. mimo says:
    May 29, 2016 at 11:25 pm

    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…

    Reply
    • WPBeginner Support says:
      May 30, 2016 at 6:24 pm

      WordPress generates your posts and pages on the fly from your database.

      Reply
      • Buck Riley says:
        Oct 10, 2016 at 8:38 pm

        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?

        Reply
        • Buck Riley says:
          Oct 10, 2016 at 8:58 pm

          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?

        • WPBeginner Support says:
          Oct 11, 2016 at 11:51 pm

          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.

        • Robert says:
          Jan 21, 2017 at 11:32 pm

          “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.

        • Josh says:
          Feb 11, 2017 at 3:11 pm

          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.

  26. Hemang Rindani says:
    May 25, 2016 at 8:49 am

    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.

    Reply
  27. Rafique says:
    May 18, 2016 at 8:33 am

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

    Reply
  28. Kang Irul says:
    Apr 20, 2016 at 4:55 am

    How to change wp-content directory??

    Reply
  29. tarif says:
    Apr 19, 2016 at 11:15 am

    Great job, sir, God bless you

    Reply

Leave a Reply Cancel 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.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WPForms Logo
WPForms
Drag & Drop WordPress Form Builder Plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
LiveChat logo
LiveChat Inc Coupon
Get a 30 day free trial and 30% OFF LiveChat, one of the best live chat service providers for WordPress users.
LearnDash
LearnDash Coupon
Get the lowest price on the best learning management system (LMS) plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.