Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Ahondev/portfolio-v2/llms.txt

Use this file to discover all available pages before exploring further.

WP SSR Framework bridges the gap between WordPress as a battle-tested CMS and modern React frontends. Instead of fighting WordPress’s template hierarchy or bolting on a decoupled REST layer, it registers a custom PHP kernel directly as a must-use plugin — seizing the request before WordPress can render anything, matching the URL to a controller, serialising page data as inline JSON, and letting a React/Vite SPA take it from there. The result is a single server response that contains both the fully-populated HTML shell and all the data the client needs to hydrate — no extra round-trips, no separate API server, no Next.js overhead.

Why it exists

Traditional WordPress themes tightly couple markup to PHP. Fully-decoupled headless setups (WordPress REST API + a separate Node frontend) solve that but introduce deployment complexity: two servers, CORS configuration, cold-start latency, and WordPress SEO plugins that were never designed for headless use. WP SSR takes a middle path:
  • WordPress stays the only server. There is no Node renderer, no separate API server.
  • React runs in the browser. After the first response, the SPA handles all navigation client-side without full page reloads.
  • Bots and crawlers get pre-rendered HTML. A built-in Static Site Generator pre-bakes every public URL to /cache/client/static/ and the bot detector serves those files instantly for search-engine crawlers and social-media link previewers.

Key features

FeatureDescription
Custom Web RouterLaravel-style Route::get() / Route::CPT() declarations wired to controller classes
EloquentCPTActive-Record wrapper for WordPress custom post types — auto-maps ACF fields as typed properties
Service ProvidersBoot-time extension points for analytics, rate limiting, SEO, caching, and routing
ComposersView-level data injectors that run once per request and merge shared data into any view
Static Site Generator (SSG)Admin-triggered or cron-scheduled HTML pre-baking for every public page and CPT
SEO ProviderACF field groups for title, description, keywords, Open Graph image, and author — plus a dashboard SEO score
Rate LimitingPer-IP, per-route transient-based limiter on all REST endpoints (100 req / 60 s)
Bot DetectionUser-agent matching for 47 crawlers and AI agents; bots are transparently served from the static cache
Vite IntegrationAuto-detects dev server via public/hot file; reads production manifest for cache-busted asset URLs

When to use WP SSR

✅ Good fit

You want WordPress as your CMS but a modern React frontend. You need SEO without a separate Node renderer. You prefer Laravel-style routing over WordPress rewrite rules. Your team already knows PHP and React.

❌ Not a good fit

You need server-side rendering on every request (use Next.js + WP REST). You need a fully static export with no PHP runtime (use Gatsby). You are building a simple blog that WordPress themes handle well.

Requirements

Before installing the framework, make sure the following are in place:
  • PHP 8.1 or higher — the codebase uses named arguments, enums, and first-class callable syntax
  • WordPress 6.x via Roots Bedrock — Bedrock provides Composer-managed WordPress, vlucas/phpdotenv, and the web/app/mu-plugins/ autoloader
  • ACF Pro — the acf_add_options_page() function is checked at kernel boot; the SEO provider and EloquentCPT rely on get_fields() to hydrate post-type models
  • Node.js 18+ / Yarn — the React/Vite frontend lives in web/client/ and requires a build step before first use
The framework calls wp_die() at boot time if ACF Pro is not active. Ensure the plugin is installed before enabling WP SSR.

Explore the framework

Quickstart

Install Bedrock, drop in the mu-plugin, define your first routes, and build the React frontend in under 10 minutes.

Architecture

Trace the full request lifecycle from WordPress boot through controller dispatch to React hydration and SPA navigation.

Routing

Learn how Route::get() and Route::CPT() work, how routes are matched, and how the JSON mode powers client-side navigation.

Post Types

Define custom post types with EloquentCPT and query them with the fluent QueryBuilder powered by ACF field auto-mapping.

Build docs developers (and LLMs) love