WP Newsify

What You Should Know About WordPress Internal Structure

Make Your Landing Page Stand Out! 10 Ingredients for a Kickass Website

As usual, may I address the problem with some questions first: How many of you here are confident that you know all about WordPress internal structure, or at least necessary information about it? How many, let’s say, suddenly realize that despite all your time working with WordPress, little do you know about its internal structure? I bet that the number of people falling into the second category is not so little, right?! But worry not, as that’s the reason for my article.

I know that many people reading up on this line would think “Heck! Why should I waste time on this article? I can do perfectly well without knowing about it just like I have done my whole career!”. To tell you the truth, you are not wrong. However, I remember reading somewhere that “Understanding is more important than perfection”, and it all rushed back into my mind when I started writing this topic. You can work perfectly well with WordPress, yes. But digging deeper into its internal structure will allow you to troubleshoot some WordPress problems yourself without having to rely on others.

Although the idea of exploring WordPress internal structure may sound frustrating at first, it is actually quite simple. That is because all WordPress themes, plugins, and any other install all have the same directory structures and core files. So, how can this article assist you?

Well, it will give you a detailed look at the following:

So that is a little bit to get the feel, not let’s come to the real works!

Introduction to the WordPress Directory Structure

You may not believe me when I said the WordPress internal structure is simple, but you might want to think again after this introduction.

To begin with, you need to have access to these files and folders. There are basically two main ways to do it, one is by using your hosting service’s cPanel file manager, another is to use a File Transfer Protocol (FTP) client. Whatever way you choose, one of the first things you should see after connecting to these files and folders is your public_html folder. This is where the three core folders, as well as many more vital files and folders of WordPress, are located, for example, the wp-admin, wp-content, wp-config.php and .htaccess.

If you look closer, you will see a variety of files and folders considered as the core of WordPress, which means you cannot edit these files by yourself. So as to be clear, this is the list of those so-called WordPress core files:

Before moving on to the three core folders mentioned above, let us have some basic information about the files and folders not that crucial, but also play an important role in maintaining the well-being of your WordPress website. The first one is .htaccess. This file grants you the control over permanent link structure, files, and folders. Moreover, it allows access to these things through your WordPress installation.

Here we have what .htaccess is supposed to look like:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Another thing worth paying attention to is the index.php which deals with WordPress’s base configuration and also includes MySQL settings, secret keys as well as database table prefix. In this directory, we also have such vital files as wp-activate.phpwp-signup.php, and wp-signup.php. While those tackle with the signup and log-in process, the wp-settings.php will establish WordPress variables and the wp-comments-post.php will handle the commenting function.

Now that we’re done with the introduction to WordPress internal structure, let’s head to the three core folders of WordPress!

Identify WordPress Core Files and Folders

Although there are many files and folders located inside the public_html that can be regarded as core files, only three of them receive the highest level of attention. These include the wp-admin folder, the wp-content folder and last but not least, the wp-includes folder.

1. The wp-admin Folder

Looking at its name, you can foresee how powerful this folder is. Actually, it is the one that grants power to any of your admin tools as a WordPress user. Let’s take an example, do you see the admin.php that lies at the center of the folder? Well, this file helps connection to the database work, at the same time showing the WordPress dashboard. Furthermore, it also enables any other key functions, including checking if any given user is the admin or not.

With an adequate amount of attention, you will see that most of the names of the files match with their functions on the WordPress dashboard. The theme-install.php concerns with the theme installation panel, just like the profile.php gives control to the user profile administration screen, for example.

In the same sense, the network powers the necessary PHP files that are needed for powering WordPress multisite. Meanwhile, the images certainly contain the images utilized in the WordPress administration panel, and CSS and js work respectively for CSS code and JavaScript.

2. The wp-content Folder

Well, here we have reached the part any WordPress user works with most of the time, the wp-content folder. Why? Because this is the folder WordPress uses to store all your themes and plugins. As we are going to elaborate on this wp-content in the very next part of this article, I will just make this part quick.

You should know that the contents of this folder can vary depending on each and every WordPress website, but typically, it has the following:

And remember that how many times you have heard people claiming it is totally fine to edit the contents of this wp-content folder, be careful when you plan to take such action!

3. The wp-includes Folder

The wp-includes folder may be listed as the last one out of the three top folders, but its role is not less important than any of the two previous folders. In fact, it is so crucial that most of the WordPress core files are located inside it.

A brand new WordPress install has about 140 distinct files in the main directory, together with another 14 folders. These include such folders as certificates, fonts, jstheme-compat, and widgets. Besides these sub-folders, several files inside the main folder are even more essential. For example, the functions.php consists of a whole range of functions without which your WordPress installation will be left paralyzed.

That is not to mention some other core files such the links.php which helps power the WordPress’ links feature, the cache.php which deals with adding and getting rid of data from the cache, or closing and resetting it, and finally the version.php which displays your version of WordPress.

To sum up, these files are of utmost importance to the existence and well-being of your WordPress website. Why is that? Well, they guarantee that every bit of your WordPress website will work in harmony with each other!

Where to Find the Stored Themes and Plugins

So, like I said just right above, the wp-content folder is where WordPress store all of your themes and plugins. Although there are more than two default folders in the wp-content (i.e. themes, plugins, uploads, languages, upgrades, etc.), I will only focus on themes folder and the plugins folders in this section.

1. The themes Folder

For each theme you install, you will get an equivalent folder on the back end. When you gain access to any theme’s folder, be prepared to face a large number of PHP files. These PHP files may seem similar for all themes, but some of the themes have its own unique files and folders. As for this unique stuff, you will only realize them if you have worked with the theme before.

The second thing to remember about the themes folder is that you can edit a theme file. However, this action is not advised as all your changes will be lost once you update the theme. You can prevent it from happening by creating a child theme, but that also means some more work to do.

2. The plugins Folder

Just like how it works with themes, each plugin on your WordPress also has its own subfolder within the plugins folder. Depending on each plugin, the contents in these subfolders are different. Unlike the case with themes, it is not advisable to edit the plugin files on your own, unless you wrote the plugin specifically for your website.

What is more, if a compatibility issue occurs with your WordPress site, one of the steps you should do is to disable plugins via FTP.

Which WordPress Files that Need Back-up

In order to save your WordPress files from the risks of hacking, data stealing, data loss and the alike, you need to backup some specific WordPress files. So what are those specific WordPress files? Well, to be honest, they are three kinds of WordPress files and your WordPress database.

How WordPress Request Works

The final thing I believe you should know about is how your WordPress website works when someone views it. Basically, when a person visits your site, it will automatically generate an HTML code (in combination with JSS and CS) and sends it to the visitor. The steps are implemented as below:

  1. The web page is requested
  2. The required PHP is called, beginning with php
  3. The WordPress core communicates with its database to get the data
  4. It then uses all data available to generate the HTML code
  5. Last, it serves this newly generated HTML code to the visitor

To repeat all the steps above every time someone visits your website may work well when there are only 10 visitors. But imagine that case when a 100 or even millions of people visit your site at the same time! No WordPress website can handle that many of visitors. So what to do? Well, this is where WordPress caching comes into the scene.

That is pretty much all the essential knowledge about WordPress internal structure you should know! Make use of it, and you will own a great website!

Exit mobile version