Scaling WordPress with Next.js

This ad is not shown to multipass and full ticket holders
React Summit US
React Summit US 2026
November 17 - 20, 2026
New York, US & Online
Upcoming event
React Summit US 2026
React Summit US 2026
November 17 - 20, 2026. New York, US & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

As modern as the web is, WordPress is still king. It’s not the most scalable, but is still compelling with its long history and UX. How can we leverage Next.js to bring WordPress to the modern web? We’ll walk through the tools that Next.js provides us to scale WordPress to the world. We’ll talk about what APIs we can use to easily wrangle WordPress content and how we can make the dynamic bits static.

This talk has been presented at React Summit Remote Edition 2021, check out the latest edition of this React Conference.

FAQ

According to Build with Trends, WordPress is used by 40% of the top 1 million websites.

In a headless approach, the backend content management system (CMS) like WordPress is decoupled from the frontend presentation layer, meaning the server-side processes are handled separately from the frontend user interface.

Jamstack refers to a modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup. When combined with WordPress, the CMS can provide content APIs that Jamstack applications consume at build time to generate static sites.

Using a static site generator like Next.js with WordPress can improve site performance, reliability, and cost-efficiency by pre-building pages into static HTML, reducing server load and enhancing speed.

Using WordPress as a headless CMS allows developers to leverage its powerful content management capabilities while using modern web technologies for the frontend, resulting in a more flexible, scalable, and performant web architecture.

WPGraphQL is a plugin for WordPress that allows data to be accessed via GraphQL, enabling developers to query the data they need in an efficient and flexible way, enhancing the integration with modern web applications.

Next.js compiles WordPress content into static pages and paths, which can be served directly from a CDN, significantly improving load times and scalability compared to traditional server-rendered WordPress sites.

Colby Fayock
Colby Fayock
9 min
14 May, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
WordPress is still widely used, with over 800 million installs. The Jamstack is a modern approach to building static HTML websites that utilize JavaScript and APIs for dynamic content. Serving static HTML files is faster than server-based solutions like WordPress. Serving static files from storage or a CDN allows for infinite scalability. WordPress is a compelling option for nontechnical users due to its familiarity and thriving ecosystem.
Available in Español: Escalando WordPress con Next.js

1. Introduction to WordPress and the Jamstack

Short description:

We're going to talk about WordPress and how we can scale it with Next.js. WordPress is still widely used, with over 800 million installs. Let's discuss how we can leverage WordPress to power static Jamstack sites. Headless architecture allows for asynchronous client-side requests and the use of Static Site Generators. The Jamstack is a modern approach to building static HTML websites that utilize JavaScript and APIs for dynamic content.

Hey, everyone. We're going to talk about WordPress and how we can scale it with Next.js. So who am I? I'm Colby Fayok. I'm the one hugging BB8 and Kylo Ren over there. I work with the dev community as a developer advocate for Appletools. You can find me pretty much anywhere on the web by just Googling my name, as I'm the only one in the world.

So let's start off by addressing the CMS in the room. It's 2021, and some developers would cringe at the thought of WordPress. But frankly, we're still living in a WordPress world. According to Build with Trends, if we look at the CMS distribution of the top 1 million sites, 40% of websites are using WordPress. I'm not quite sure how accurate this number is, but if you look at the number of detections on the built with site, it's over 800 million installs of WordPress. That's a staggering number. While we might not all want to use WordPress, it's realistically around to stay for the foreseeable future. So let's talk about how we can take advantage of the King CMS and use it to power our static Jamstack sites in 2021.

So to start, what does Headless actually mean? With our traditional stack, somebody visits a page in the browser. The browser reaches out to the server. The server will do all the work like request data from our database, where it then returns the HTML for the page and returns a response. And if we're lucky, it'll return that cache. Finally, the browser displays that response to the person visiting the site. With a Headless approach, that request to the server is asynchronous on the client. In this particular example, the person would visit a page in the browser and immediately get a response straight from storage. Once that page loads in the browser, the browser will kick off another request to a server, which can load all the dynamic content. But I would imagine you'd be wondering, why would we want to make a client-side request to a CMS like WordPress? And that's not necessarily the recommended approach, that's where Static Site Generators come in to do the hard lifting before your page is the browser, which is what has given rise to what people now call the Jamstack.

Maybe you've heard of the Jamstack on Twitter, or maybe it's completely new, but what exactly is it? At the core, Jamstack sites are static HTML websites. This isn't a new idea, but it's a modern approach. Typically, they use JavaScript in the browser to make any request to your APIs that would provide dynamic data. Or they can use those APIs at compile time and serve that dynamic content without an extra client-side request. One example that we can imagine is building a React application. This would serve as our JavaScript player. We would want to use the WordPress API to provide the content and the dynamic data.

2. WordPress and the JAMstack

Short description:

We would compile the site to a static site using Next.js or another tool, which is a static site generator. JAMstack sites have built-in features for performance, reliability, and cost. Serving static HTML files is faster than server-based solutions like WordPress. Load balancing and auto scaling are not perfect solutions for handling traffic. Serving static files from storage or a CDN allows for infinite scalability. Storage is cheap, and managing servers can be expensive. WordPress is a compelling option for nontechnical users due to its familiarity and thriving ecosystem.

We would compile that down to a static site using Next.js or another tool, which, along with a lot of other features, is a static site generator.

Now, if this is all new to you, it sounds like a lot of work. Why not just use WordPress out of the box like we always do? The great thing about JAMstack sites is they have a lot of compelling features kind of built right in. By default, we're living up to what AWS considers a well-architected infrastructure. These are features that we all care about, like performance, reliability, and cost.

With most of the server-based solutions like WordPress, there are a lot of options to help speed things up. For WordPress specifically, that includes plugins to cache or some custom work under the hood. But each page is still a server hit, which is prone to its ups and downs. On the other hand, serving a plain, static HTML file is just going to be fast. Instead of spending time rendering on a server, you serve a static file straight from storage or a CDN. While you can do this with a default WordPress, it's often a lot more complicated. In some of the plugins, that cache might serve an HTML file, but they still serve it from a regular server, not storage. With any server, we're typically paying for how much we expect our traffic to be. While most of the time that's predictable, we all hope that one day one of our posts will go viral. And if that happens, the people visiting our site will be the ones paying for it with slow speeds and timeouts.

There are solutions like load balancing and auto scaling, but those aren't perfect solutions and might not always handle a certain traffic. Back to the fact that we're serving static HTML files, because we're serving files straight from storage, or better yet, static files directly from a CDN, buzzword alert, that means our user facing website is going to infinitely scale. That static site will survive the Reddit hug of death when your post goes viral. But managing servers isn't always cheap. While a low traffic personal blog can manage a few dollars a month, the more that traffic grows, the more that cost is going to quickly grow. While you have options again like load balancing and auto scaling, those services quickly add without it, you risk your site slowing down or worse, downtime. Storage is really, really cheap. We can maintain huge static projects on AWS using S3 for a really low cost. But even if we still manage a server, that usage is going to be much, much lower with only content managers or requests that compile time.

While there are a ton of headless solutions or options out there, it is a headless world WordPress still has a lot of features that makes it compelling to use. One issue with a lot of the recent solutions is they seem to be very developer focused, and that's not necessarily a bad thing, but you have to know your audience. If the ultimate goal is for the CMS to be used by people who are nontechnical, you're providing an experience that people might struggle to learn and use. WordPress is the most used CMS in the industry. That means most of our clients are already going to be familiar with WordPress. There's a huge ecosystem already thriving around WordPress.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Routing in React 18 and Beyond
React Summit 2022React Summit 2022
20 min
Routing in React 18 and Beyond
Top Content
Routing in React 18 brings a native app-like user experience and allows applications to transition between different environments. React Router and Next.js have different approaches to routing, with React Router using component-based routing and Next.js using file system-based routing. React server components provide the primitives to address the disadvantages of multipage applications while maintaining the same user experience. Improving navigation and routing in React involves including loading UI, pre-rendering parts of the screen, and using server components for more performant experiences. Next.js and Remix are moving towards a converging solution by combining component-based routing with file system routing.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
The New Next.js App Router
React Summit 2023React Summit 2023
27 min
The New Next.js App Router
Top Content
Today's Talk is about the Next.js App Router, which has evolved over the years and is now a core feature of Next.js. The Talk covers topics such as adding components, fetching remote data, and exploring layouts. It also discusses submitting form data, simplifying code, and reusing components. The App Router allows for coexistence with the existing pages router and enables data fetching at the layout level using React Server Components.
You Don’t Know How to SSR
DevOps.js Conf 2024DevOps.js Conf 2024
23 min
You Don’t Know How to SSR
Top Content
The Talk covers the speaker's personal journey into server-side rendering (SSR) and the evolution of web development frameworks. It explores the use of jQuery for animations in SSR, the challenges faced in integrating React with Umbraco, and the creation of a custom SSR framework. The Talk also discusses the benefits of Next.js and the use of serverless artifacts for deployment. Finally, it highlights the features of Astro, including its function per route capability.
From Segments to Suspense: The Future of Next.js Caching
React Advanced 2025React Advanced 2025
27 min
From Segments to Suspense: The Future of Next.js Caching
Introduction to Cache Components in Next.js 16, transforming the app router with new features like partial pre-rendering, Dynamic I.O., and caching directives. Deep dive into static params generation in Next.js focusing on changes in generating static params for improved performance. Exploring challenges of generating static params and balancing static vs. dynamic rendering for better performance. Addressing challenges with cache components, optimizing static and dynamic rendering for improved performance. Understanding impact of parameters on rendering with cache components, managing dynamic components, and introducing suspense boundaries for faster page loads. Enhancing cache life APIs, introducing a new caching model for static outputs in Next.js. Revolutionizing cache management with granular control over cache lifetimes and dynamic segment configuration. Navigating data and caching in Next.js, exploring cache components guidance and caching differences between server and client components.
How to properly handle URL slug changes in Next.js
TypeScript Congress 2022TypeScript Congress 2022
10 min
How to properly handle URL slug changes in Next.js
Top Content
This Talk explains how to handle URL slug changes in Next.js by using the getStaticPaths and getStaticProps methods. It covers implementing redirects and provides a solution to eliminate the need for editors to perform additional steps. The approach involves tracking URL slug changes and issuing proper redirects. The speaker encourages the audience to reach out with any questions or experiences with handling URL slugs.

Workshops on related topic

AI for React Developers
React Advanced 2024React Advanced 2024
142 min
AI for React Developers
Top Content
Featured Workshop
Eve Porcello
Eve Porcello
Knowledge of AI tooling is critical for future-proofing the careers of React developers, and the Vercel suite of AI tools is an approachable on-ramp. In this course, we’ll take a closer look at the Vercel AI SDK and how this can help React developers build streaming interfaces with JavaScript and Next.js. We’ll also incorporate additional 3rd party APIs to build and deploy a music visualization app.
Topics:- Creating a React Project with Next.js- Choosing a LLM- Customizing Streaming Interfaces- Building Routes- Creating and Generating Components - Using Hooks (useChat, useCompletion, useActions, etc)
Tracing: Frontend Issues With Backend Solutions
React Summit US 2024React Summit US 2024
112 min
Tracing: Frontend Issues With Backend Solutions
Top Content
Featured WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
Frontend issues that affect your users are often triggered by backend problems. In this workshop, you’ll learn how to identify issues causing slow web pages and poor Core Web Vitals using tracing.
Then, try it for yourself by setting up Sentry in a ready-made Next.js project to discover performance issues including slow database queries in an interactive pair-programming session.
You’ll leave the workshop being able to:- Find backend issues that might be slowing down your frontend apps- Setup tracing with Sentry in a Next.js project- Debug and fix poor performance issues using tracing
This will be a live 2-hour event where you’ll have the opportunity to code along with us and ask us questions.
From Frontend to Fullstack Development With Next.js
React Summit 2025React Summit 2025
91 min
From Frontend to Fullstack Development With Next.js
Top Content
Featured Workshop
Eric Burel
Eric Burel
Join us as we journey from React frontend development to fullstack development with Next.js. During this workshop, we'll follow along the official Next.js Learn tutorial with Eric Burel, professional trainer and author of NextPatterns.dev. Together, we'll set up a Next.js website and explore its server-side features to build performant apps.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
Workshop
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
Workshop
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
From Todo App to B2B SaaS with Next.js and Clerk
React Summit US 2023React Summit US 2023
153 min
From Todo App to B2B SaaS with Next.js and Clerk
Top Content
WorkshopFree
Dev Agrawal
Dev Agrawal
If you’re like me, you probably have a million side-project ideas, some that could even make you money as a micro SaaS, or could turn out to be the next billion dollar startup. But how do you know which ones? How do you go from an idea into a functioning product that can be put into the hands of paying customers without quitting your job and sinking all of your time and investment into it? How can your solo side-projects compete with applications built by enormous teams and large enterprise companies?
Building rich SaaS products comes with technical challenges like infrastructure, scaling, availability, security, and complicated subsystems like auth and payments. This is why it’s often the already established tech giants who can reasonably build and operate products like that. However, a new generation of devtools are enabling us developers to easily build complete solutions that take advantage of the best cloud infrastructure available, and offer an experience that allows you to rapidly iterate on your ideas for a low cost of $0. They take all the technical challenges of building and operating software products away from you so that you only have to spend your time building the features that your users want, giving you a reasonable chance to compete against the market by staying incredibly agile and responsive to the needs of users.
In this 3 hour workshop you will start with a simple task management application built with React and Next.js and turn it into a scalable and fully functioning SaaS product by integrating a scalable database (PlanetScale), multi-tenant authentication (Clerk), and subscription based payments (Stripe). You will also learn how the principles of agile software development and domain driven design can help you build products quickly and cost-efficiently, and compete with existing solutions.