finds.dev← search

// the find

9d8dev/next-wp

★ 1,262 · TypeScript · MIT · updated Feb 2026

Headless WordPress built with the Next.js App Router and React Server Components

A Next.js App Router starter that connects to WordPress as a headless CMS via the REST API. Targets teams who want to keep WordPress for content editing but replace its frontend with React Server Components. The Railway one-click deploy is genuinely useful — it spins up MySQL, WordPress, and Next.js as a complete stack.

The wordpress.ts API layer is well-organized with typed return values and dedicated functions for every entity (posts, pages, authors, categories, tags) rather than one generic fetch wrapper. Cache revalidation is done properly — webhook-triggered tag-based revalidation instead of timed ISR, so WordPress publishes propagate immediately. The included WordPress plugin ships in the repo and gets pre-installed on Railway, removing a common setup footgun. Vitest test coverage hits the real pain points: webhook secret validation, pagination headers, and error handling on the fetch layer.

The REST API approach means N+1 problems are easy to stumble into — fetching a post list then fetching each author separately is the natural path through the provided API functions, and there's no GraphQL or batching option to avoid it. Authentication for draft/private content is absent; the entire API layer assumes publicly readable WordPress, so if you need preview mode or protected content you're rebuilding a significant chunk of wordpress.ts. The lib/wordpress.ts file will become a maintenance burden as it grows — it's already a flat list of 20+ functions with no grouping by domain, and every new content type means manually adding another set of CRUD-style functions.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →