Every WordPress page starts as a URL and ends as HTML, and the same eleven stages sit in between every time. This map follows one request through all of them, shows what each stage does and which files and hooks are involved, and points to the fix when one of them breaks. The timings are from a real traced request, not a guess.
- Static files never reach WordPress. The web server answers images, CSS and JavaScript itself.
- Everything else goes through
index.php. Pretty permalinks are a rewrite rule, not real folders. - Plugins and the theme load on every request, including REST, admin-ajax and cron calls.
- The URL becomes a database query before any template is chosen.
- A page cache can answer before the database is even touched.
Prefer to watch?
The six-minute version. The video follows the same GET /hello-world/ request through the web server, core, plugins and hooks, the query, the template and the caches, then the map below lets you explore each stage at your own pace.
Interactive map
Follow one request through WordPress
GET /hello-world/
A visitor opens a blog post and nothing is cached. Every layer does its job.
- 01 Browser Sends the request skipped
- 02 CDN or proxy Optional front layer skipped
- 03 Web server Nginx, Apache or LiteSpeed skipped
- 04 PHP PHP-FPM worker + OPcache skipped
- 05 Bootstrap wp-config.php and wp-settings.php skipped
- 06 Plugins and theme Your code joins in skipped
- 07 Routing URL to query skipped
- 08 Database MySQL or MariaDB skipped
- 09 Template The template hierarchy skipped
- 10 Render The Loop, wp_head, wp_footer skipped
- 11 Response HTML goes back skipped
Stage 1
Browser Sends the request
REST API: JavaScript sends this one: the block editor, a mobile app or a headless front end. A logged-in browser must send an X-WP-Nonce header with REST requests; without it WordPress treats the request as logged out.
admin-ajax: A script on the page sends a POST to /wp-admin/admin-ajax.php with an action field naming the job.
WP-Cron: No browser asks for this. While a normal page loads, WordPress checks for due events on init and, if any are due, fires a request at its own /wp-cron.php with a 0.01 second timeout and blocking off, so the visitor never waits for it.
The browser looks up the domain in DNS, opens a TLS connection and sends GET /hello-world/ with any cookies it holds for the site.
One cookie matters more than the rest: wordpress_logged_in_…. Page caches use it to decide who gets a cached copy, and logged-in visitors normally skip the cache entirely, which is why the admin bar user sees a slower site than everyone else.
Stage 2
CDN or proxy Optional front layer
Cached page: With an HTML cache rule at the edge, a cached page is answered right here and your server never sees the request at all.
WP-Cron: Loopback requests such as WP-Cron may go out through the proxy and back in. A firewall rule or bot challenge that blocks your own server breaks scheduled posts quietly.
Cloudflare, a load balancer or Varnish often sits in front of the server. It answers images, CSS and JavaScript from its own cache and passes everything else through. Most CDNs do not cache HTML unless you add a rule for it.
A proxy usually ends HTTPS itself and talks to your server over plain HTTP. WordPress then sees an HTTP request, is_ssl() returns false, and you get mixed content warnings or redirect loops until the proxy's X-Forwarded-Proto header is trusted.
When it breaks here
Stage 3
Web server Nginx, Apache or LiteSpeed
Cached page: Some cache plugins write pages to disk and add rewrite rules so the web server returns the HTML file directly, skipping PHP as well. Everything after this stage is then skipped.
If the URL matches a real file, such as an image in wp-content/uploads, the web server sends it straight back and PHP never runs. That is most of the requests a page makes.
/hello-world/ is not a file. With pretty permalinks, a rewrite rule hands every such URL to index.php, and WordPress works out what it means later. On Nginx that is one line:
try_files $uri $uri/ /index.php?$args;
Request size limits live here too. A 413 on upload comes from the web server before WordPress is involved.
Files involved
.htaccessnginx.conf
Stage 4
PHP PHP-FPM worker + OPcache
The web server passes the request to a PHP-FPM worker. Each worker handles one request at a time, so when every worker is busy new requests queue, and the queue is where 502 and 504 errors come from.
OPcache keeps compiled PHP in memory. Without it, PHP would parse every file on every request, and a single post page on the test site loaded 498 PHP files. memory_limit and max_execution_time apply to this worker for the whole request.
Files involved
php.iniwww.conf
When it breaks here
Stage 5
Bootstrap wp-config.php and wp-settings.php
Cached page: Here is where the cached page is sent. The page cache drop-in runs at step 3, finds a stored copy, prints it and exits. WordPress never connects to the database and no plugin or theme code runs.
admin-ajax: admin-ajax.php defines DOING_AJAX and loads wp-load.php directly instead of going through index.php.
WP-Cron: wp-cron.php defines DOING_CRON, then loads WordPress. On PHP-FPM it calls fastcgi_finish_request() first, so the caller gets its empty response at once while the tasks keep running.
index.php loads wp-blog-header.php, which loads wp-load.php, which finds wp-config.php with your database details, keys, salts and constants. Then wp-settings.php builds WordPress in a fixed order:
- Show the maintenance page if a
.maintenancefile exists - Set error reporting from
WP_DEBUG - Load the
advanced-cache.phpdrop-in ifWP_CACHEis on - Connect to the database
- Start the object cache (
object-cache.phpdrop-in, if present)
"Error establishing a database connection" is printed at step 4, before any plugin or theme code has run.
Files involved
index.phpwp-blog-header.phpwp-load.phpwp-config.phpwp-settings.php
When it breaks here
Stage 6
Plugins and theme Your code joins in
admin-ajax: admin-ajax.php also loads the admin APIs and fires admin_init, so anything hooked there runs on every AJAX call.
REST API: Every active plugin loads for every REST request, even ones that have nothing to do with the route being called.
Must-use plugins load first, then every active plugin, then the theme: the child theme's functions.php before the parent's. After that WordPress works out who the visitor is and fires init, where core and plugins register post types, taxonomies, blocks and shortcodes.
On the test site init alone took 12.5 ms, the biggest slice of everything before the query. A heavy plugin adds its cost here, and it adds it to every request, including REST, admin-ajax and cron.
A fatal error in any of this code stops the request with "There has been a critical error on this website".
Hooks fired here (ms on the test site)
muplugins_loaded0.1plugins_loaded3.8setup_theme5.7after_setup_theme6.6set_current_user8.4init8.5wp_loaded21.0
Files involved
wp-content/mu-plugins/wp-content/plugins/functions.php
When it breaks here
Stage 7
Routing URL to query
REST API: On parse_request, rest_api_loaded() spots the /wp-json/ route, fires rest_api_init so routes get registered, checks the route's permission_callback, runs its callback and sends JSON. The main query and the theme never run.
admin-ajax: admin-ajax.php skips routing. It fires wp_ajax_{action} for logged-in users or wp_ajax_nopriv_{action} for everyone else. If no function is hooked to the action, the answer is 0 with a 400 status.
WP-Cron: wp-cron.php skips routing. It reads the due events from the cron option and fires each event's hook with its saved arguments.
wp() matches the URL against the rewrite rules saved in the database and turns /hello-world/ into query variables such as name=hello-world. The request filter can change them, then the main WP_Query runs, with pre_get_posts as the last chance to adjust it.
If nothing matches, WordPress marks the request as a 404. Then it sends headers and fires template_redirect, where canonical redirects and old-slug redirects happen.
Hooks fired here (ms on the test site)
parse_request22.0pre_get_posts22.0send_headers23.4template_redirect23.5
Files involved
wp-includes/class-wp.phpwp-includes/class-wp-query.php
Stage 8
Database MySQL or MariaDB
REST API: The posts controller builds its own WP_Query from the request parameters, so a REST call hits the database much like a page view.
admin-ajax: Whatever your AJAX callback queries. Nothing else is loaded for it.
WP-Cron: Each scheduled task runs its own queries. A task that loads every post at once is the usual cause of a slow or failing cron run.
The main query becomes SQL. This is the one the test site ran for a single post:
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hello-architecture' AND wp_posts.post_type = 'post' ORDER BY wp_posts.post_date DESC
It is rarely the only one. The whole page took 47 queries on a default block theme with no plugins: templates, navigation, global styles and a list of recent posts all ask for their own rows. A persistent object cache such as Redis keeps many of those answers between requests.
Hooks fired here (ms on the test site)
posts_request22.1
Files involved
wp-includes/class-wpdb.php
When it breaks here
Stage 9
Template The template hierarchy
template-loader.php asks what kind of request this is, in a fixed order: embed, 404, search, front page, blog home, privacy page, post type archive, taxonomy, attachment, single post, page, any singular, category, tag, author, date, any archive, and finally index.
For a single post it then looks for the most specific file first, in the child theme before the parent:
single-post-hello-worldsingle-postsinglesingularindex
Classic themes look for .php files. Block themes look for .html templates, and for edited copies saved in the database. The template_include filter can still swap the result.
Hooks fired here (ms on the test site)
template_include30.9
Files involved
wp-includes/template-loader.phpsingle.phptemplates/single.html
When it breaks here
Stage 10
Render The Loop, wp_head, wp_footer
The template runs the Loop, and the_content passes the post through its filters: blocks are rendered, shortcodes expanded and paragraphs added. wp_head() prints styles, scripts and meta tags; wp_footer() prints whatever was left for the footer.
Block themes do this in an order that surprises people. The test trace showed the whole page body, content included, rendered before wp_head fired: the_content at 46.3 ms, wp_head at 58.9 ms. WordPress builds the block template first so every block can enqueue the CSS it needs, and only then prints the head. In a classic theme, header.php calls wp_head() first.
Hooks fired here (ms on the test site)
loop_start31.1the_content46.3loop_end54.2wp_head58.9wp_enqueue_scripts58.9wp_footer68.5
Files involved
wp-includes/template-canvas.phpheader.phpfooter.php
Stage 11
Response HTML goes back
Cached page: The stored copy goes back unchanged. No query ran, so a cached page cannot show anything that changed after it was saved until the cache is cleared.
REST API: The response is JSON, with headers such as X-WP-Total for paginated collections.
admin-ajax: Callbacks usually end with wp_send_json(). A callback that only echoes and returns gets a stray 0 after its output, from the final wp_die( '0' ).
WP-Cron: Nobody reads this response. Problems only show up as posts that missed their schedule or tasks that never ran.
The finished HTML, 67 KB for the test post, travels back through the web server and proxy to the browser. The shutdown hook fires last, and a page cache stores a copy for the next visitor.
The browser now parses the HTML and requests every stylesheet, script, font and image it found. Each one is a new request, and almost all of them are answered at the CDN or web server stage without touching PHP.
Hooks fired here (ms on the test site)
shutdown69.2
When it breaks here
Timings are milliseconds after the first must-use plugin loaded, from one traced single-post request on a test site: WordPress 7.1.3, PHP 8.2.35, Twenty Twenty-Five, no plugins and no object cache. Your numbers will differ; the order will not.
Every hook, in the order it fired
Hooks are how WordPress lets your code join in. An action is a moment you can run code at; a filter is a value you can change on its way through. That is how a plugin changes WordPress without editing a line of it, and the short alongside shows it in under a minute.
The timeline below is the first firing of the hooks that matter most, measured on a single post request. Read it as the answer to “is it too early to call that function here?”
- Load
- Route and query
- Template
- Render
- Finish
-
muplugins_loaded0.1 ms Must-use plugins are in -
plugins_loaded3.8 ms Every active plugin is in -
sanitize_comment_cookies5.6 ms -
setup_theme5.7 ms Theme about to load -
after_setup_theme6.6 ms Child, then parent functions.php ran -
set_current_user8.4 ms WordPress knows who is visiting -
init8.5 ms Post types, taxonomies and blocks registered -
widgets_init9.5 ms -
wp_loaded21.0 ms WordPress fully loaded -
parse_request22.0 ms URL matched to query variables -
pre_get_posts22.0 ms Last chance to change the main query -
posts_request22.1 ms Main query SQL built -
send_headers23.4 ms -
wp23.4 ms Query done -
template_redirect23.5 ms Redirects happen here -
template_include30.9 ms Template file chosen -
loop_start31.1 ms -
the_content46.3 ms Post content rendered -
loop_end54.2 ms -
wp_head58.9 ms Head printed after the body (block theme) -
wp_enqueue_scripts58.9 ms -
wp_footer68.5 ms -
shutdown69.2 ms Request finished
Five things the trace shows
- A page cache runs before the database connects.
wp-settings.phploads theadvanced-cache.phpdrop-in before it connects to MySQL, so a cache hit never opens a database connection and never loads a plugin. - Block themes render the body before the head.
the_contentfired at 46.3 ms andwp_headat 58.9 ms. WordPress builds the block template first so each block can enqueue its own CSS, then prints the head. Code that expectswp_headto have run before the content will be wrong on a block theme. initis the expensive part of loading. It took 12.5 ms, more than everything before it combined, because core registers post types, taxonomies, blocks and block styles there. Plugins add their own registrations on top.- One post took 47 queries and 498 PHP files with no plugins at all. Templates, navigation, global styles and the recent posts list each ask the database for something. That is why OPcache and an object cache make such a difference.
- The child theme loads before the parent. Its
functions.phpruns first, so a child can declare a function the parent wraps infunction_exists(), but it cannot call parent functions until a later hook.
Where WordPress keeps everything
A fresh single-site install creates twelve tables. Almost everything you make ends up in wp_posts, with extra details in wp_postmeta; settings, plugin options and the cron schedule all live in wp_options. The wp_ prefix is set in wp-config.php and may be different on your site.
Content
wp_posts
Every post, page, attachment, revision and menu item, plus block templates, global styles and custom post types. post_type tells them apart.
ID, post_type, post_status, post_name
wp_postmeta
Extra fields per post: featured image, custom fields and most plugin data.
post_id → wp_posts.ID
Categories and tags
wp_terms
The name and slug of each category, tag or custom term.
term_id, name, slug
wp_term_taxonomy
Which taxonomy a term belongs to, its parent and how many items use it.
term_id → wp_terms
wp_term_relationships
Links posts (and links) to terms.
object_id ↔ term_taxonomy_id
wp_termmeta
Extra fields per term.
term_id → wp_terms
Users
wp_users
Login name, hashed password, email and display name.
ID, user_login, user_email
wp_usermeta
Roles and capabilities, login sessions and personal settings. The role key carries the table prefix: wp_capabilities.
user_id → wp_users.ID
WordPress around the world, in numbers
- 38.4% of all websites run WordPress W3Techs, 23 November 2026
- 57.3% of sites with a known CMS W3Techs, 23 November 2026
- 76,072 free plugins in the directory WordPress.org
- 8,901 free themes in the directory WordPress.org
- 66.9% of sites already on WordPress 7.1 WordPress.org
- 31.4% run a PHP version with no security fixes WordPress.org + php.net
Market share among content management systems
Share of websites whose CMS W3Techs can identify. 33.0% of all sites use none it monitors. Source: W3Techs, 23 November 2026.
Which WordPress version sites run
Latest release: 7.1.5. It needs PHP 7.4 and MySQL 5.5.5 or newer.
Which PHP version WordPress sites run
Red bars are PHP branches past their security support date on php.net.
Which database server they use
The most installed plugins
- Elementor Agent Ready Website Builder10M+
- Yoast SEO – Advanced SEO with real-time guidance and built-in AI10M+
- Contact Form 710M+
- Classic Editor8M+
- LiteSpeed Cache7M+
- WooCommerce7M+
- Site Kit by Google – Analytics, Search Console, AdSense, Speed5M+
- Akismet Anti-spam: Spam Protection5M+
Active installs as WordPress.org reports them, rounded down to a bucket.
Version, PHP, database and directory figures refresh daily from WordPress.org and php.net; last refreshed 23 November 2026, 21:18 UTC. WordPress.org only counts sites that check in for updates, so treat them as a large sample rather than a census.
Frequently asked questions
Is WordPress an MVC framework?
No. It is event-driven. Instead of routing a URL to a controller, WordPress turns the URL into a database query, picks a template from the template hierarchy, and lets plugins change almost anything along the way through actions and filters. WP_Query plays the part a model would, and templates play the view.
Does every plugin load on every request?
Every active plugin’s main file loads on every request that boots WordPress: page views, the admin, REST API calls, admin-ajax and WP-Cron. Well-built plugins only register hooks at that point and do their real work later, when a hook says it is needed. Requests answered by a page cache or straight from the web server skip plugins entirely.
Why is the admin slower than the front end?
The admin is never page-cached, loads the admin APIs on top of everything else and usually runs more queries per screen. Logged-in visitors on the front end also skip most page caches because of their login cookie, so they see the uncached speed too.
What is the difference between an action and a filter?
An action runs your function at a moment and ignores what it returns: add_action( 'init', … ). A filter passes a value to your function and uses what you return: add_filter( 'the_content', … ). Under the hood both use the same hook system, which is why add_action() simply calls add_filter().
Where should I hook my code?
Register post types, taxonomies and shortcodes on init. Change the main query on pre_get_posts. Redirect on template_redirect, before any output. Add styles and scripts on wp_enqueue_scripts. Register REST routes on rest_api_init.
Sources: WordPress 7.1.3 source code (wp-settings.php, wp-includes/template-loader.php, wp-includes/template-canvas.php, wp-admin/admin-ajax.php, wp-cron.php), traced on a test site; Template Hierarchy and Hooks in the WordPress developer handbook; Database Description; usage statistics from the WordPress.org stats API, PHP support dates from php.net and market share from W3Techs.
Comments
wp_commentsComments, pingbacks and trackbacks, approved or not.
comment_post_ID → wp_posts.ID
wp_commentmetaExtra fields per comment, such as spam-check results.
comment_id → wp_comments