How WordPress Generates a Page

Understand the complete request path so that performance work targets the correct layer.

2 min read

  • Article
  • Beginner
  • 2 minutes read
  • Reviewed August 4, 2026
  • WordPress performance

When a visitor opens a WordPress URL, several systems work before the page becomes visible and interactive.

Understanding this path prevents server problems from being diagnosed as image problems and browser problems from being blamed on the database.

Request and Network

The browser resolves the domain through DNS, establishes a connection and negotiates HTTPS.

A CDN or reverse proxy may answer directly from cache. If it cannot, the request reaches the origin server.

Web Server and PHP

The web server maps the URL to WordPress and passes dynamic requests to PHP.

PHP loads WordPress configuration, core files and active extensions. Runtime version, process availability, memory and opcode caching can affect this stage.

WordPress Bootstrap

WordPress initializes:

  • Configuration.
  • Must-use plugins.
  • Active plugins.
  • Theme functions.
  • Object cache.
  • User and session context.
  • Rewrite and query systems.
  • Registered post types, taxonomies and blocks.

Broad hooks and synchronous remote calls can add delay before the main query is complete.

Main Query and Database

WordPress interprets the URL and creates the main query.

It may retrieve posts, terms, metadata, options and users. Themes and plugins can add more queries or alter the result.

A persistent object cache can avoid selected repeated database work, while full-page caching can bypass most PHP generation for cacheable pages.

Template Rendering

WordPress selects a template according to the request context and template hierarchy.

The theme renders HTML, often with additional blocks, query loops, menus, widgets, shortcodes and plugin output.

Browser Work

The server sends HTML and response headers.

The browser then discovers and downloads CSS, JavaScript, fonts, images and embedded content. It parses, lays out, paints and executes scripts.

Fast server generation does not guarantee a fast or responsive browser experience.

Performance Checkpoints

Measure:

  • DNS and connection time.
  • Cache hit or miss.
  • Server response time.
  • PHP and database work.
  • HTML size.
  • Render-blocking resources.
  • Main-thread JavaScript.
  • Image and font loading.
  • Layout stability.
  • Interaction response.

Frequently Asked Questions

Does WordPress query the database for every page?

A normal uncached dynamic request does, although object and page caches can reduce or bypass work.

Does a CDN replace WordPress hosting?

No. It can serve cached resources and proxy requests, but the origin still generates uncached and dynamic responses.

Continue Learning

Previous: Performance

Next: Understanding WordPress Performance Metrics