How to change the WordPress file structure. Hierarchy of theme (template) files Wp includes what's in this folder

💖 Do you like it? Share the link with your friends

Template files are the main building blocks of your WordPress site. They fit together like puzzle pieces to form the web pages on your site. Some templates, such as header and footer, are commonly used on all web pages of a site, while others can only be used under certain conditions.

A traditional web page consists of two files:

  • contains the structure and content of the page
  • contains page appearance parameters.

WordPress has an (X)HTML structure and CSS styles, But content is formed "behind the scenes" by various . Template and stylesheet files are stored with . To learn more about creating themes, read the article.

WordPress Page Structure

A simple WordPress web page is made of three main blocks: header, content and footer. Each of these blocks is generated based on the template file of the current WordPress theme.

Heading

  • Heading contains all the information that should be upstairs- i.e. inside the tag - your XHTML web page, just like tags , and links to style sheets. It also includes an open tag and the visibility of your blog (which usually contains the name of your site, but may also contain a navigation menu, logo, site description, etc.).
  • Block content contains your blog posts and pages, i.e. the "base" of the site.
  • Basement contains information that is at the bottom pages, such as links to the rest or categories of your site in , copyright, contact information and so on.

Main template files

To create the structure, start with the index.php template file in your theme folder. This file has two main functions:

  • Include or "call" other template files
  • Enable to get information from the database (posts, pages, categories, etc.)

In our simplified structure, we only need to include two other template files: title And basement. They should be named header.php and footer.php . that include them look like this:

If you want to show your blog posts and pages (and customize them appearance), the index.php file should run between calls to the header and footer files.

More complex page structures

Heading

Side panel

Many WordPress themes use one or more , which contain and Additional information about your site. The sidebar is created using the sidebar.php template file. It can be included in the index.php template file using the following line():

Where is everything else?

Note that we haven't included a template tag for "receive" content our web page. This is because the content is rendered in , inside index.php .

Template files inside template files

You learned how WordPress includes the standard template files (header, footer, and sidebar) in the index.php file. But you can also include other template files in any of your files.

For example, sidebar.php may contain a template file that generates the search string - searchform.php . Because This is not one of the standard WordPress template files, the code to include will be slightly different:

We no longer need to use "include" and "TEMPLATEPATH" to insert our search form into themes, because WordPress provides us with the above template tag.

Heading

Comment form

Side panel

Search form

Many WordPress themes include various template files for creating web pages on the site. Below is a list of typical files for the main template (index.php) of a WordPress site:

  • header.php
    • theloop.php (content)
    • wp-comments.php
  • sidebar.php
    • searchform.php
  • footer.php

But, in any case, this structure can be changed. For example, you might want to insert a search string into the title. Or your design doesn't include a basement, so you might as well not use one at all.

Special template files

There are two main ones in WordPress kind pages on the site. View single recording used when a web page displays a single blog post. View several records lists multiple blog entries, or a summary of entries, and applies to category archives, date archives, author archives, and (usually) the "normal" view of the blog home page. You can use the index.php template file to generate all of these types of pages, or rely on to select other template files depending on the situation.

The WordPress template hierarchy answers the following question:

Which template file will WordPress use when generating a certain type of page?

WordPress automatically recognizes template files with certain standard names and uses them for a specific type of page. For example, when a user clicks on the title of a blog post, WordPress knows that the user wants to see that particular article on their own page. WordPress will use the single.php template file instead of index.php to form the page - if your theme has a single.php file. Also, if a user clicks on a link for a specific category, WordPress will use the category.php template if it finds one; if not, it will look for archive.php , and if that template doesn't exist, WordPress will use the main index.php template. You can make a special template for a specific category (see), or even templates.

Here are some tips for creating template files:

Track opening and closing tags Template files involve the use of tags and links to . HTML elements and CSS links can "cross" template files, i.e. start in one file and end in another. For example, the HTML elements html and body usually start at header.php and end at footer.php . Most WordPress themes use HTML div elements, which can also span multiple files. For example, the main div for page content might start at header.php and end at either index.php or single.php . Keeping track of the start and end of HTML elements can be quite challenging in the process. Use

If you want to use the full potential of WordPress, then you definitely need to learn more about templates. When WordPress renders a page, it uses templates to determine how everything should look. Moreover, the CMS adheres to a strict hierarchy, thanks to which everything looks organized and coherent. Knowing what the WordPress template hierarchy is and how it works will help you customize your site's theme more precisely.

The WordPress template hierarchy consists of seven main categories:

  1. Site's home page
  2. Single entry
  3. Static page
  4. Category and Tags Page
  5. Custom Post Types
  6. Search results page
  7. Page 404 (nothing found)

In this guide, we will introduce you to WordPress templates and their hierarchy. We'll also explain how themes use template files to display pages on your site. We have a huge field of activity before us, so let's get to work on it!

Introduction to Template Files (And How They Relate to WordPress Themes)

When you create a simple static website, you usually just use HTML and CSS to render and customize its appearance. WordPress, on the other hand, is much more powerful. The platform is built in PHP, and it uses several special .php files to define how individual parts of your site pages are built.

For example, look at the right side of this post. There is a sidebar pointing to other similar posts from our blog. When your browser told WordPress to load this article, it pulled several template files at the same time, one of which is called sidebar.php. This file contains information about how to display the sidebar you see now and what elements it should include:

Sidebars are, of course, only one part of a complete page. Most WordPress pages require several template files to work, including:

  • index.php
  • header.php
  • sidebar.php
  • footer.php
  • functions.php
  • single.php
  • comments.php

It should be noted that these are not all template files that you can find in WordPress. header.php, sidebar.php And footer.php, are especially important because they are known as 'template partials'. This means that they can be embedded into other templates.

WordPress's approach to creating pages may seem complicated at first. However, this approach is quite effective. If you had a unique template for every single page on your site, customization would be a nightmare. The modular approach to WordPress templates allows you to make changes in one file and use that element anywhere on the site.

When it comes to choosing templates for each page, the first thing WordPress does is check your current theme. Each theme includes its own set of template files, which will take precedence over all others. This is part of what we call the 'WordPress template hierarchy' in action, which we'll look at in the next section.

Now that you understand how WordPress renders your pages, it becomes clear that themes are basically a collection of template files. In practice, a theme only requires one template file, and that is - index.php. However, most themes include many more templates. For those things that are not covered in the chosen theme, WordPress falls back to other files in its hierarchy to fill those gaps.

How the WordPress Template Hierarchy Works

In the previous section, we introduced you to some example WordPress template files. However, these were just some of the templates that can be used when loading a page or post. The WordPress template hierarchy determines which templates are used and in what order.

For example, if you try to load a page for an abstract category hosting, then this is what will happen in the background:

  1. WordPress will look for a template file called category-hosting.php in the current theme directory.
  2. If the file category-hosting.php will not be found, WordPress will look for the one that uses the category ID, e.g. category-2.php.
  3. If WordPress doesn't find any of these options, it will look for the shared file category.php.
  4. If the file is named category.php will not be found, WordPress will fall back and look for the template archive.php.
  5. Finally, if all else fails, the platform will download the file index.php your theme and will use it as a page template.

Some template files always take precedence over others, so they are organized into a hierarchy. Broadly speaking, WordPress sites consist of seven categories of pages, each of which has its own strictly defined hierarchy. Now let's look at what these categories are and how their hierarchies work.

WordPress Template Hierarchy Explained (7 Categories)

The pages of each WordPress site can be divided into seven categories. Each of these categories has a built-in hierarchy, and we'll guide you through each one.

1. Home page of the site

First of all, let's talk about the first (main, home) page of your site. When WordPress loads the home page or home page, the first thing it will look for is the file front-page.php. If this file is not available, the platform will fall back to home.php. If both files are missing, WordPress will fall back to the always trusted file index.php, which is always there (otherwise your theme won't work).

In other words, this hierarchy is divided as follows:

  1. front-page.php
  2. home.php
  3. index.php

Even if these three files are the same, WordPress will still follow its internal logic. Of course, this particular hierarchy is quite simple. Let's move on to the page category, which is a little more complicated.

2. Single recording

WordPress articles (like this one) fall under the single post category. At the beginning of this section, we talked about some of the template files involved in creating a record. However, these were mostly internal elements. Before WordPress can render them, it must determine which template file to use for the page as a whole.

Here's how the single record hierarchy works:

  1. single-(post-type).php
  2. single.php
  3. singular.php
  4. index.php

You probably won't recognize some of these template files, so let's give them some context. Top of the list single-(post-type)-(slug).php. More clear example May be single-product-ca-12.php, in the case of an online store. In other words, WordPress will look for a unique template file for each post you upload within its specific category. If the platform cannot find a suitable template, it will go back a step to single-(post-type).php and so on until it inevitably reaches again index.php.

In practice, this approach allows you to create custom templates for individual records or products. However, if you prefer to use one WordPress template for all your posts, this requires single.php.

3. Static page

Statically, pages fall into their own category in WordPress. For example, take the Hostinger site as a whole. https://www.site is ours home page, and when accessed, the template is loaded front-page.php. Other sections of the site, such as https://www.site/kupit-hosting-sajtov, fall into the category of static pages.

Static pages implement the following hierarchy:

  1. Custom Template File
  2. page(slug).php
  3. page-(id).php
  4. page.php
  5. singular.php
  6. index.php

Please note that the first item in the list is not the file name. This is because WordPress can recognize multiple types of content as static pages. For example, if you're dealing with a post, WordPress will default to the hierarchy we talked about earlier. Static pages, on the other hand (such as /kupit-hosting-sajtov), ​​will move directly to page-slug.php. In our example it will be page-kupit-hosting-sajtov.php(if such a file exists).

From this point on, this hierarchy works in the same way as with records. If there is no template for a unique page structure, WordPress will look for one that matches its ID, and so on. As always, in the end all paths lead to index.php, if you don't find a solution in earlier steps.

4. Category and tag pages

As you may recall, we actually looked at category hierarchy earlier in this article as an example. Anyway, let's break down the patterns this hierarchy covers in order:

  1. category(slug).php
  2. category-(id).php
  3. category.php
  4. archive.php
  5. index.php

This hierarchy works the same as for single posts and static pages. WordPress will look for a template that is unique to the category you want to upload, first by its filename, which includes its special slug, and then by its ID. If this approach fails, it will work with category.php, and then archive.php. After all, your WordPress archive should include posts from all of your categories, so it makes sense to include it in this particular hierarchy.

We also mention WordPress tags in this section because both categories and tags are taxonomic elements. Also, their hierarchies are exactly the same, except that you are replacing all instances of the category ‘ category' to tag ' tag', and then - category-(slug).php becomes tag-(slug).php etc.

5. Custom (custom) post types

If you're not familiar with , then it's worth noting that this type of content generally doesn't fall under WordPress's default classification. For example, if you start a blog that focuses on reviews, you can create a custom post type called reviews ( reviews), and configure it to enable additional features.

However, creating custom post types is a topic for another tutorial. On this moment suffice it to say that these content types have their own hierarchy:

  1. archive-(post_type).php
  2. archive.php
  3. index.php

As you can see, this hierarchy is not formed as clearly as some others. However, there are still several levels of patterns before moving on to index.php, which is enough to create complex pages.

6. Search results pages

  1. search.php
  2. index.php

In this case, WordPress will immediately go to index.php, if it can't find a custom template for your search results page. However, most modern themes will include some customization for your search page.

7. Page 404 (nothing found)

A 404 page is an error page. Typically, you hope your users never see these pages, but it's still important to take care of them just in case. WordPress doesn't come with custom error pages out of the box, but they're fairly easy to install.

If you create your own error page, WordPress will look for it first, as shown in this hierarchy:

  1. 404.php
  2. index.php

In our opinion, it's worth taking the time to create a custom error page if your site high traffic. This way, your users won't be scared off on the rare occasion that an error appears.

WordPress Template Hierarchy in Action

In this final section, we'll look at how the WordPress template hierarchy can work in a real-life situation. We'll use a hypothetical site as an example.

Imagine you've created a website that includes a home page, a couple of static pages, and a bunch of posts. You are also using a custom theme that includes these template files:

  • index.php
  • home.php
  • page.php
  • archive.php
  • category.php

This is a small and neat collection of template files, but it is more than enough to get the site running. In this case, if you visited the home page, WordPress would load the template home.php.

Below are examples of other pages you might visit and the template files they will use:

  • A random post would load index.php as a template file because there are no other templates in the hierarchy in question.
  • Any visited category will use the template file category.php, since such a WordPress template is available. If it wasn't there, WordPress would load it instead archive.php.
  • Your static pages will use page.php, but they will default to index.php, if the first file is not available.
  • Since there is no error page among the templates, WordPress will use index.php as a template in this situation.

There are many examples that can be given, but this example should give you an idea of ​​how such a site would work. Which templates WordPress will use is determined by the theme settings and hierarchies we talked about earlier. We hope that this manual will serve well Starting point, if you need to work with the WordPress template hierarchy in the future.

Conclusion

The WordPress template hierarchy may seem complicated at first glance. However, in the sections above we have outlined which template files take precedence over each other. With this information, you will know exactly which files you need to fix if you want to make changes to your current WordPress theme.

Do you have questions about the hierarchy of WordPress templates and how they work on your site? Ask a question in the comments section below!

Before we dive into the topic of caching, we need to understand how WordPress works. Not only how posts are created and edited, but how several thousand lines program code intertwine with each other and create beautiful dynamic sites.

WordPress Internals

We all know how to work with WordPress. It all starts with logging into the control panel, followed by publishing, changing or uploading content, installing or updating the necessary plugins, backup and so on. But have you ever thought about how it all works?

The basic basis of all websites is HTML (from the English. HyperText Markup Language- “hypertext markup language”).

The ultimate goal of WordPress is to generate HTML pages, which happens dynamically.

The key term to understand here is "dynamically". The terms "HTML page" and "web page" are synonymous. At the most basic level, WordPress uses PHP and a SQL database to store all of its data.

So we have two objects:

  • The PHP code that makes up the core of WordPress
  • and the database, which is the memory of WordPress.

Each WordPress CMS uses one database. No more and no less. Every bit of information you have entered or will add to your site in the future is stored in the WordPress database.

This includes:

  • user login, password (encrypted with MD5) address Email and etc.;
  • all posts, pages, tags, categories and connections between them;
  • custom post types;
  • revisions, drafts and deleted entries;
  • approved comments and those awaiting moderation, as well as any spam;
  • theme customization options;
  • plugin data and much more.

But images, documents and other uploaded files are not stored in the WordPress database. They are located in the “wp_content” folder. Let's look at this in more detail.

All images (and other media files) that are uploaded to the site are stored in the "uploads" directory. They are distributed by year, month and day. This folder can be considered a database for all non-text data - images, PDFs, videos, MP3s and more. Access to this folder and its subfolders should also be restricted. This can be done by changing the .htaccess file, which is located in the wp_content directory.

Therefore, when creating a backup copy, you need to copy not only folders WordPress installations. You need to copy both the database and all the contents of the root directory.

Anatomy of a WordPress Query

Or as I like to call it,

What happens when someone views your site?

When someone visits your site, WordPress dynamically generates HTML code (according to CSS and JS), which is displayed as a site page. You won't see a .html extension after the URL (as you might see on some older websites) since this content is dynamically generated.

Here's what happens when you request a web page:

  1. The visitor's browser requests a web page.
  2. The WordPress core (can be considered the brain of WordPress) calls the required PHP scripts, starting with index.php.
  3. WP Core then connects to its database and retrieves data (posts, pages, comments and other information).
  4. It then combines the extracted data, data from currently active plugins and the currently active theme and generates HTML code on the fly i.e. dynamically.
  5. It then serves this dynamically generated HTML code to the visitor's browser.

Hello friends. Very often, when answering questions from readers, you have to face the fact that when asking questions about the various functionality of themes or plugins, many do not even imagine the basic structure of their website on the server. This is surprising, but true. In this article, we will look at the basics of the most important, standard WordPress folders, paying special attention to the root files, on the basis of which your site actually works.

WordPress Directory Structure

The WordPress file structure is very simple. Do you have a folder public_html, where there are usually three key folders, as well as many other important files, including wp-config.php And .htaccess

To access files and folders, you can use file manager cPanel from your hosting service or any regular

For this review we will use the most popular ftp client - FileZilla. This is what the folder should look like public_html inside:

Before we look at these top three folders, let's look at the files that are inside public_html just for fun. First of all there is .htaccess, with which you can control the structure of permalinks, files and folders, as well as manage access rights to them in your WordPress installation. This is what a standard file looks like .htaccess without any changes:

# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-d RewriteRule . /index.php [L]#ENDWordPress

Then, there is a file that by default represents your home page, unless of course it is replaced with pages like front-page.php or home.php:

Another required file in this directory is wp-config.php. This file Allows you to set up basic WordPress configuration, including database settings MySQL, secret keys, and database prefix information. This is what your database settings should look like:

// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define("DB_NAME", "notarealname"); /** MySQL database username */ define("DB_USER", "notarealuser"); /** MySQL database password */ define("DB_PASSWORD", "notarealpassword"); /** MySQL hostname */ define("DB_HOST", "localhost");

Other notable files in this directory are wp-activate.php, And wp-signup.php, which are collectively responsible for the registration, authorization and confirmation process of user registration. File wp-comments-post.php is responsible for the commenting function and preventing duplication of content, while wp-settings.php is responsible for setting some WordPress variables.

As is clear from the name of the folder, this is where the admin tools are located. For example, admin.php(the heart of this folder) allows you to associate the installation with a database, displays the WordPress control panel and offers other key functions, such as checking whether a given user is an administrator. If the user is an administrator, then the use of the file is enabled wp-load.php which in turn downloads the file wp-config.php:

/** * In WordPress Administration Screens * * @since 2.3.2 */ if (! defined("WP_ADMIN")) ( define("WP_ADMIN", true); ) if (! defined("WP_NETWORK_ADMIN")) define( "WP_NETWORK_ADMIN", false); if (! defined("WP_USER_ADMIN")) define("WP_USER_ADMIN", false); if (! WP_NETWORK_ADMIN && ! WP_USER_ADMIN) ( define("WP_BLOG_ADMIN", true); ) if (isset($_GET["import"]) && !defined("WP_LOAD_IMPORTERS")) define("WP_LOAD_IMPORTERS", true); require_once(dirname(dirname(__FILE__)) . "/wp-load.php");

If you pay attention to the names of these files, you will realize that most of them tell the user about the functions they perform that are familiar to you from the WordPress admin. For example, profile.php displays the user profile administration screen, theme-install.php controls the theme installation panel, and plugin-install.php does the same for the plugin installation panel.

As for other important folders inside wp-admin, That images filled with pictures that are used in the WordPress admin panel, css and js are “homes” for CSS code and JavaScript scripts, and network includes PHP files required for WordPress multisite functionality

This is probably where you spend most of your time working with WordPress, as this is where the most used files and features are collected, namely themes and plugins:

Each plugin you download has its own folder within this shared folder, as seen in the example above. The content of each folder, of course, varies from plugin to plugin. Here, for example, is what the folder of the popular Akismet plugin looks like.

If you experience any problems, you should use FTP access to disable extensions. This can be done by deleting or simply temporarily renaming the folder with the conflicting plugin.

Just like with plugins, each theme has its own subfolders. If we open the folder with any theme, we will see there are many PHP files that together create the look and structure of your theme. Let's take the famous Divi theme from Elegant Themes as an example, in the main folder of which we will find the files , a functions.php, a sidebar.php, And style.css, among the rest. Divi also has separate folders for css, images and theme js, which is pretty standard for most quality themes. But be that as it may, some other folders are quite unique, for example, epanel And et-pagebuilder:

Another folder is wp-includes, and it's quite big. wp-includes contains all those files that are not included in the previously described folders. Relatively speaking, it is thanks to this folder that the site works like a clock.

The folder is so important because this is where most of the WordPress core files are located. A new WordPress installation contains 140 different files in the main directory and 14 different folders(at the time of writing), including certificates, fonts, js and widgets.

But these subfolders are not as important as the files that are in the main directory, for example, functions.php. This small file is an important part of the WordPress core, as it contains many different functions that allow WordPress to run smoothly. For example, the line of code data is the first thing you will see if you open this file, and this function is needed to transform the data into other formats.

/** * Convert given date string into a different format. * * $format should be either a PHP date format string, e.g. "U" for a Unix * timestamp, or "G" for a Unix timestamp assuming that $date is GMT. * * If $translate is true then the given date and format string will * be passed to date_i18n() for translation. * * @since 0.71 * * @param string $ format Format of the date to return. * @param string $ date Date string to convert. * @param bool $translate Whether the return date should be translated. Default true. * @return string|int|bool Formatted date string or Unix timestamp. False if $date is empty. */ function mysql2date($format, $date, $translate = true) ( ​​if (empty($date)) return false; if ("G" == $format) return strtotime($date . " +0000"); $i = strtotime($date); if ("U" == $format) return $i; if ($translate) return date_i18n($format, $i); else return date($format, $i); )

Other key files are cache.php(manages the process of adding and removing data from the cache, and is also responsible for closing or restarting it), links.php (functionality that is responsible for WordPress links) and version.php (responsible for the WordPress version).

I really hope that this article will allow beginners to gain a basic understanding and knowledge of the structure of your WordPress site. Agree - not every driver needs to be a car mechanic, but everyone who drives should know where the engine is in the car and where the suspension is. Well, that’s true, by the way :)

Want to learn more about the WordPress file structure? And also about the kernel software WordPress, themes, plugins and all the user uploads that are stored on the site? I will talk about all this in this article.

Why do you need to know the WordPress file structure?

Many users start working with WordPress without any idea about its files and directories, which is very bad. After all, knowledge about WordPress files and directories, where what is stored and why, can help resolve many common problems without outside help.

In this article you will learn:

  • Which files and directories are root.
  • Where WordPress stores images and media uploads.
  • Where does WordPress store themes and plugins?
  • Where are the configuration files stored?

Now let's move on to exploring the WordPress file structure.

Accessing WordPress Files and Directories

To get started, log into your WordPress server using an FTP client. For more details, read the guide on how to use FTP to upload WordPress files (working in progress). An easier alternative to FTP is File Manager (a web application with a built-in cPanel administration panel). Once you log into WordPress via FTP or File Manager, you will see a file and directory structure something like this:

The WordPress root files are highlighted in red. It depends on these files correct work website, under no circumstances change anything in them yourself.

Here is a list of these files and folders in the root directory:

  • wp-admin
  • wp-includes
  • 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

Configuration files

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

  • .htaccess is a server configuration file, WordPress uses it to manage permalinks and .
  • wp-config.php – Tells WordPress how to connect to the database. It also sets some important settings.
  • index.php is an index file that basically loads and initializes all WordPress files when a user requests a page.

Sometimes there is a need to edit wp-config.php or .htaccess files. Be extremely careful and careful when doing this. Any minor error can make your website unavailable. That is why, before changing anything here, be sure to do backups these files. If you do not see the .htaccess file in the root directory, then read the instructions on why the .htaccess file is not visible in the root directory (being written).

Depending on your WordPress installation, you may or may not have the following files in your root directory:

  • robots.txt – contains all the instructions for crawling search bots
  • Favicon.ico – the favicon file is sometimes generated by the hosters themselves.

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

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

  • themes
  • plugins
  • uploads

WordPress stores site themes in the /wp-content/themes/ folder. You can edit the theme file, however this is generally not recommended. Once you update your website theme version, all your changes will be applied during this update. This is why it is recommended to customize the main theme.

All loaded and installed plugins WordPress stores in a folder /wp-content/plugins/. It is not recommended to edit plugin files unless you have created the plugin yourself for the needs of the site.

In many WordPress instructions you can see codes that are inserted into the site. It's best to add them to your child theme's functions.php file or to a site-specific plugin.

WordPress stores all images and media uploads in a folder /wp-content/uploads/. By default they are stored in folders like /year/month/. Every time you backup your site, don’t forget about this folder.

You can download copies of WordPress core, themes, and plugins from their sources, but if you lose your downloads folder, it will be difficult to recover without a backup.

The wp-content directory also stores other standard folders, such as:

  • languages ​​– this folder stores all language files of non-English-language sites.
  • upgrade is a temporary folder, created by WordPress when updating the site version.

wp-content also stores folders that are created by plugins. For example, the screenshot above shows the gallery folder created by the plugin. Some of these folders may contain very important files. For example, the “gallery” folder stores all the images. Always make backup copies of such folders to avoid losing important data.

Other folders contain files that you can safely delete. For example, W3 Total Cache or WP Super Cache can store cached files in their folders.

That's all. I hope this article helped you understand the WordPress file structure.

Don't forget to subscribe to my YouTube channel, find me on VKontakte and Twitter.



tell friends