Call Me On 0807 708 8529

WordPress is the most popular free platform for creating websites on the Internet. And its popularity WordPress has earned mainly due to how easy and simple to work with it.

In order to create your own site on WordPress, you do not need to understand the code and know how everything is tripled. But if you are a novice developer or just an experienced user, and you are interested in learning how WordPress works, then this article is for you.

See also :

In this post, we will look at step by step what happens inside WordPress when you download the site in a browser, and step by step we will list the order of loading functions and WordPress files. Let’s go!

Why do I need to know how WordPress works?

WordPress is an open-source project, so anyone can study its source code and learn how to create its own plug-ins and templates.

If you know the basics of how WordPress works under the hood, this will help you deepen your knowledge of the design. Also it’s just informative from the point of view of how seemingly elementary things really are.

WordPress download order

So, you entered the URL of the WordPress site in the address bar of your browser and hit Enter. There was a resolving of the domain name, and your browser addressed a specific IP-address to the hosting server with a request to load the site.

What happens next in the next fractions of a second, until the site is displayed in the browser window?

1. Downloading the wp-config.php file

First of all, the main configuration file wp-config.php is accessed in the root directory of WordPress.

From there, global variables are extracted for the WordPress site, as well as information for connecting to the Database.

11 tips for configuring the wp-config.php file

2. Load of standard constants

After downloading wp-config.php, WordPress retrieves the values ​​of standard constants. They include information such as the location of the upload-directory (wp-content /), the maximum file size and all other constants that are registered in wp-config.php.

3. Download advanced-cache.php file

If the file advanced-cache.php is on the site, WordPress loads it at this stage. This file is the so-called “Encapsulation” in the terminology of WordPress plugins.

It is created automatically if one of the cache plug-ins is configured on the site. This file contains configuration information for caching the site.

4. Downloading the wp-content / db.php file

WordPress allows developers to create their own abstract database layers and upload them through a file db.php . Typically, this file can be used by some cache plugins to optimize the operation of the database.

Therefore, if such a file exists, it is loaded at this stage.

5. Connecting to MySQL and the Database

WordPress now has enough information to connect to the MySQL server and connect to the database specified in the wp-config.php or db.php database.

If for some reason WordPress can not connect to the database, you will see the message “Error establish database connection” on a white background.

6. Download the file object-cache.php or wp-includes / cache.php

WordPress will now download the file object-cache.php if any. If not, it will try to download the file wp-includes / cache.php . If there is not, then the next step.

7. Downloading the wp-content / sunrise.php file

If the site is part of the Multisite-network WordPress, then the file wp-content / sunrise.php will be downloaded.

8. Loading the localization library

The file wp-includes / l10n.php is now loaded for inclusion of the localization system. At this stage, the selected language, regional settings and files for translation will be taken into account.

9. Download Multisite-plugins

Again, if the site is on the WordPress Multisite network, Multisite plug-ins will now be downloaded.

10. Performing the function “muplugins_loaded”

The function (or WordPress-Action terminology) is running muplugins_loaded for WordPress Multisite network plugins.

11. Download all activated plugins

WordPress will now download all the other activated plugins on the site.

The list of activated plugins is stored in the Database wp_options in the field active_plugins .

Thus, all installed but inactive plugins are ignored during the boot phase.

12. Downloading the file pluggable.php

File pluggable.php stores functions that can be overridden by WordPress plugins.

WordPress will check if functions from the pluggable.php file are defined by some other active plug-ins. If not, functions from pluggable.php will be defined.

13. Running the function “plugins_loaded”

Similar to muplugins_loaded for WordPress Multisite plugins, the plugins_loaded function will now be executed. This function allows developers to bind their own functions and execute them after downloading all active WordPress plugins.

14. Download Rewrite Rules

The override rules for links will be loaded.

In other words, SEO-understandable constant links will be loaded instead of references of the form /? P = 10467

15. Initialization $ wp_query, $ wp_rewrite, $ wp

Now WordPress will download such objects:

  • $ wp_query : A global variable that contains the class WP_Query . She tells WordPress that the content is requested in a typical WordPress query format.
  • $ wp_rewrite : A global variable that contains the class WP_Rewrite . Contains Rewrite rules and functions for URL redefinition when downloading content.
  • $ wp : A global variable that contains the class WP . Contains functions that will parse your request and perform a load of the main queue (main query).

16. Running the function “setup_theme”

WordPress performs the function setup_theme necessary for the stage before loading the skin.

17. Loading the functions.php file of the child theme

The file functions.php contains a set of functions and instructions applicable to each theme individually.

If you use a child theme, then the functions.php of the child theme will be loaded at this stage.

Otherwise, functions.php will be loaded from the main active skin.

18. Loading the functions.php file of the parent theme

If a child theme is used, after loading functions.php from the child theme, the functions.php of the main parent theme will be loaded.

19. Performing the function “after_setup_theme”

The function after_setup_theme is executed after WordPress has determined which theme is active at the moment and uploaded its functions.php file.

This is the first action applicable to an active subject.

20. Configuring the current User Object

WordPress now loads the current user’s object. This allows WordPress to understand which requests can be fulfilled in the future in accordance with the current user role and its privileges.

21. Performing the “init” function

At this stage, WordPress has already downloaded all the necessary information for work. The function init is now executed.

This function allows developers to add their own code, which should be executed immediately after WordPress has loaded and executed all previous items.

22. Running the function “widget_init”

The function widget_init allows developers to register widgets and execute the code necessary for the operation of widgets.

23. Performing the function “wp ()”

WordPress now calls the function wp () from the file wp-includes / functions.php .

This function sets the global variables $ wp $ wp_query $ wp_the_query and then calls $ wp-> main .

24. Parsing requests

WordPress now has all the necessary information to process user requests. For starters, the rewrite override rules are checked.

Then all filters, action hooks are loaded and a request to download the header -part of the site is sent.

25. Running queries

If no content is detected for a given query, WordPress defines the variable is_404 .

Otherwise, WordPress continues to load the remaining requests.

  • Will be executed WP_Query-> get_posts ()
  • Next, the function DO_ACTION_REF_ARRAY pre_get_posts ‘ is started for the object WP_Query .
  • Now apply apply_filters for stripping requests and some final checks.
  • Now the records themselves are loaded from the database, filters are applied posts_results and the_posts .

The query execution stage is complete, and WordPress issues the downloaded records.

26. Performing the template_redirect function

The template_redirect function is running just before WordPress determines which template to load.

27. Download Feed-Template for RSS

If the requested content belongs to the RSS feed, WordPress loads the corresponding Feed Template.

28. Loading the main template (theme)


WordPress starts downloading files of the current active theme according to its hierarchy.

Typically, everything starts with a file that contains the main loop (WordPress Loop).

29. Performing the function “shutdown”

At the very end, before the completion of the entire PHP code, WordPress launches the last function shutdown .

At this stage the WordPress work is completed and completed.

30. Loading the site page in the browser

All “prepared” PHP code from WordPress is transferred to the web hosting server for execution.

The web server processes the PHP code and sends the finished HTML code to the user, along with styles and scripts (CSS and JavaScript) for loading the page itself.

The browser renders this page using the HTML, CSS, and JavaScript received from the web server, and as a result you see (visually) the requested page of the site.


So, we have written down in detail the 30 steps that WordPress needs to download the site. Well, ok, the last 30th item is already executed without WordPress, but still.

And now think about it!

All of these 30 points from the moment you hit Enter in the address bar of the browser and before the page loads in literally in a few milliseconds! Fantastic, right?


Leave a Reply

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

Copy Protected by Chetan's WP-Copyprotect.