Directory Structure in WordPress 2022

What is the directory structure in WordPress?

Directory structure in WordPress 2022: You have probably often wondered what the directory structure is in WordPress and where can I find the most important directory and files on my WordPress installation. For some WordPress users, this is a book with seven seals. Probably most WordPress users can manage and administer their WordPress site without ever having learned anything about WordPress files or directories. If you understand how WordPress stores files and directories, you can solve many common problems in WordPress on your own.

That’s why we want to reveal the secret of the WordPress directory structure a little bit here. The importance of knowing about this topic becomes apparent when you want to clean up your storage or delete certain files because you no longer need them. If you want to upload a new plugin or theme via FTP, you should also know in which directories the folders and files need to be inserted.

This guide will help you:

Learn which WordPress files and folders are core files.

Understand where WordPress stores your images and media uploads.

Recognize where WordPress stores your themes and plugins.

Know where configuration files are stored in your WordPress installation.

Access to WordPress files and directories

To access the folders and files, you’ll need an FTP client. This allows you to connect to your WordPress server. For detailed instructions, check out our guide on how to use FTP to upload WordPress files.

Another simple alternative to using an FTP client is the file manager. It’s a web-based application that integrates with the cPanel dashboard of your WordPress hosting.

Once you’ve connected to your WordPress site via either FTP or the file manager, you’ll see a file and directory structure that looks something like this:

JoewP - WordPress Directory Structure
WordPress structure with folders and files in the root directory

List of the most important WordPress files and folders in the root directory of your WordPress site:

  • [dir] WP-Admin
  • [dir] wp-content
  • [dir] wp-includes
  • .htaccess
  • index.php
  • wp-activate.php
  • wp-blog-header.php
  • wp-comments-post.php
  • wp-config.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

List of directories in the root directory

  • WP-Admin The directory contains all the files necessary for the operation of the dashboard or the backend.
  • wp-includes The directory contains all the files that are responsible for normal WordPress operation
  • wp-content Here you will find all content that is created by the user through the operation of WordPress.

List of files and directories in wp-content

  • wp-content/plugins Contains all the plugin files you have installed. All WordPress plugins you install on your website are stored in the /wp-content/plugins/ folder. Plug-in files should generally not be edited directly. In many WordPress tutorials, you’ll find so-called “code snippets” that you can add to your WordPress site. The best way to integrate custom code into your WordPress site is to add it to the file functions.php of your child theme (the “child theme”) or create a site-specific plugin.
  • wp-content/themes Contains all currently installed themes. Among them is at least the current standard WordPress theme. WordPress stores your design files in /wp-content/themes/ in a subfolder. You can edit a design file, but it’s not recommended. Once your theme is updated to a newer version, your changes will be overwritten when you update. For this reason, we recommend creating a child theme for WordPress theme customization.
  • wp-content/languages The Language Directory. For all free plugins and themes, WordPress will always download the latest language files. You can find them in this folder.
  • wp-content/uploads Here you can find all the files you uploaded (images or media files) from the media library. They are usually divided into year and month. Many plugins also use this directory to cache files. That’s why you’ll often find folders called “temp” or “logs” there. Whenever you create a WordPress backup, the “Uploads” folder should be included. If you lose your upload folder for any reason, it’s very difficult to restore it without a backup.
  • wp-content/upgrade This folder is used by WordPress when the core updates itself. Ultimately, the downloaded files must first be cached and unzipped before they are moved to their appropriate location. It is, so to speak, a pure working directory.
  • wp-content/mu-plugins This is another plugin directory. It includes all the plugins that need to be loaded first. MU stands for “Must-Use”.
  • wp-content/cache This is another plugin directory. It includes all plugins that are responsible for caching the website.

The following files (i.e. not only folders) can also be found in this directory. These drop-ins allow you to replace more complex things in WordPress (caching settings, interface to the database connection, etc.).

  • wp-content/advanced-cache.php Allows for more complex caching mechanisms.
  • wp-content/db.php Allows you to replace the database interface.
  • wp-content/db-error.php Allows developers to edit their own database error messages.
  • wp-content/install.php Often used by web hosts who want to use their own installation routines.
  • wp-content/maintenance.php As soon as WordPress updates itself, it briefly switches to a maintenance mode. This is then just a white page with black text. in this file, the layout of the page can also be changed.
  • wp-content/object-cache.php To avoid always having to query the database slowly, certain queries can be cached in a so-called object cache. This is done with this file. It is often inserted by plugins.

Files in the root directory

  • index.php The index.php receives all requests generated in the frontend and produces an output that is then displayed in the user’s browser. Internally, it loads the file wp-blog-header.php.
  • .htaccess A server configuration file that uses WordPress to manage permalinks and redirects. You may need to edit the .htaccess file yourself in certain cases. Be especially careful when editing this file. The slightest mistake can destroy your website and it will no longer be accessible on the web. When editing the file, always back up your computer before making any changes. If you don’t see a .htaccess file in your root directory or are having trouble with it, check out our extensive guide on the .htaccess file.
  • wp-blog-header.php This file loads the file wp-load.php, starts WordPress, so to speak, and prepares it for the next request.
  • wp-load.php This file merges certain files. It loads the wp-config.php and then the wp-settings.php.
  • wp-config-sample.php or wp-config.php When you download WordPress for the first time, there is no wp-config.php file in the root directory. However, it is needed to provide WordPress with the access data to the database. The wp-config.php is created from the wp-config-sample.php when you go through the WordPress installation process. The wp-config-sample.php can then be deleted because it is no longer needed. We have described how you can optimize the file wp-config.php in this blog post .
  • wp-settings.php This file is loaded from the wp-load.php file and takes care of making sure that all PHP settings are done correctly. It is also responsible for establishing a connection to the database and loading the activated plugins.
  • wp-activate.php If it has been specified in the WordPress settings that users can register themselves, the user will receive an email with an activation link after registration. This link contains a code that is checked by wp-activate.php. It is used to verify the existence of the user’s email account.
  • wp-comments-post.php When a user makes a comment, the data recorded there (such as the comment text) must be processed and stored. This file is responsible for this. After successful saving, the file will redirect you to the original page.
  • wp-cron.php WordPress allows the time-controlled execution of actions (cronjobs). These actions represent PHP functions. This way, you can have a post published at a predefined time on a timed basis. The cronjob then regularly checks whether a post needs to go online or not. The wp-cron.php cannot be called up independently by WordPress and must always be triggered externally. That’s why cron jobs often have delayed executions. To avoid these time delays, certain web hosts (but also plugins) offer real cron jobs. These are called by the operating system at the desired time. The wp-cron.php then checks which actions should be carried out and executes them. You can read more about the cron job on our blog post .
  • wp-links-opml.php In earlier versions of WordPress Dashboard, there was a menu item with “links” on which links could be stored. With the wp-links-opml.php, these links could be exported directly.
  • wp-login.php With the help of the wp-login.php, you can log in to the WordPress dashboard. It displays the login form on the frontend.
  • wp-mail.php The file is responsible for sending mails. You can then use WP Mail SMTP to configure your email deliverability in WordPress to use an appropriate SMTP provider when sending emails.
  • wp-signup.php If you allow user registrations, wp-signup.php will display a registration form.
  • wp-trackback.php The file is responsible for the track and pingback system in WordPress. It is, so to speak, an interface for exchanging backlinks for the comment system.
  • xmlrpc.php XML-RPC is also an interface for exchanging data. This can be used to publish blog posts about third-party applications, for example.

Conclusion

We hope this article has helped you understand the file and directory structure of WordPress. If you would like to learn more about the topic or if you would like to be trained or coached by us for specific functions, please feel free to contact us.

JoeWP WordPress Agency - Request

Do you want to be trained or coached by us?