Skip to content
Home » Learn about files and directory structure in WordPress

Learn about files and directory structure in WordPress

 

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

Why should you learn about WordPress files and directory structure?

Most users can run their WordPress website without understanding WordPress files or directories. However, knowing how WordPress stores files and folders can help you solve many common WordPress problems.

The following guide will help you:
  • Learn which WordPress files and directories are roots.
  • How WordPress stores the images and things you upload.
  • Where WordPress hosts themes and plugins.
  • Understand where configuration files are stored on WordPress.
  • This information also helps you understand which WordPress files you need to back up.

You will also be able to fix some problems yourself, such as deactivating all active plugins, going back to the default theme, or fixing common WordPress errors.

Let us learn about WordPress files and directory structure.

Access WordPress files and folders

First, you will need an FTP client to connect to your WordPress server.

An easy alternative to FTP is File Manager. It is a web-based application that comes with the cPanel dashboard of your WordPress hosting account.

Once you have connected to your WordPress site, using FTP or a file manager, you will see a file and folder structure that looks like this:

The files and folders in the red squares are the core WordPress files. These are the files and directories that run the website. You do not need to edit the above files.

Here is a list of WordPress files and core folders in the root directory of your website.
[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

There are some special configuration files in your root WordPress directory. These files contain important settings specific to your site.

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

Sometimes you will need to edit the wp-config.php or .htaccess file. Be careful when editing these two files. One small mistake can make your site inaccessible. When editing these two files, always make a backup on your computer before making any changes.

if you don’t see the .htaccess File in the root directory, then refer to our guide.

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

  • robots.txt – Includes instructions for the search engine’s scanner
  • favicon.ico – Sometimes a favicon file is generated by the WordPress host.

Inside wp-content directory

WordPress stores all your uploads, plugins, and themes in the wp-content directory.

People often think that it is possible to edit files and directories inside the wp-content directory. However, this is not entirely true.

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

The contents of the wp-content directory may differ between different WordPress websites. But all WordPress websites usually include:

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

WordPress stores your theme files in a directory /wp-content/themes/. You can edit any theme file, but you shouldn’t do that much. Immediately after updating your theme to the new version, your changes will be overwritten in the update.

This is why when it comes to customizing a theme you should create a child theme.

All WordPress themes you have downloaded and installed on your website are stored in the folders /wp-content/themes/ . You do not have the right to edit the theme file directly unless you have just written a theme for your own WordPress site.

In many WordPress tutorials, you will see snippets of code to add to your website. The best way to add custom code to your WordPress site is to add the theme’s functions.php file or create a specific web theme.

WordPress stores all uploaded images and multimedia files in folders /wp-content/uploads/. By default, these uploaded files are sorted into folders /year month/. Whenever you create a WordPress backup, you should create an upload

You can download fresh copies of the original WordPress, themes, and theme plugins, but if you lose the uploads folder it will be difficult to restore without a backup.

Some other default directories you might see in the wp-content directory include:
  • languages – Where to store language files for non-English pages
  • upgrade – This is a temporary directory created by WordPress when it is being upgraded to a newer version

Many WordPress plugins can also create their own directories within the wp-content directory. For example, we have a gallery folder created by the Envira gallery theme.

Some of those folders may contain important files like the gallery folder may contain your gallery images. You should always back up such folders to avoid losing important data.

Other directories may contain files that you can safely delete. For example, your caching plugin, such as WP Rocket or WP Fastest Cache, may store cache files in its own directory.

We have covered this article, hope this article helps you to understand more about WordPress files and directory structure.

Leave a Reply

Your email address will not be published. Required fields are marked *