How to Deploy WordPress on Vercel in 2026 - Complete Guide
Combining WordPress content management with Vercel's blazing-fast edge network · Photo: Pexels
A headless WordPress + Vercel stack gives you the best of both worlds: the familiar WordPress editor for your content team, and the performance of a modern CDN-deployed site that loads in under 1 second globally.
Can You Deploy WordPress Directly on Vercel?
Short answer: No, not directly.
Vercel is a frontend cloud platform optimised for JavaScript frameworks like Next.js, Nuxt, SvelteKit, and Astro. WordPress is a PHP application. Vercel does not support PHP hosting.
The correct approach is the headless architecture - described below.
What Is Headless WordPress?
Think of traditional WordPress like a restaurant where the kitchen (backend) and the dining room (frontend) are in the same building.
Headless WordPress separates them. The kitchen (WordPress PHP backend) stays in one place and manages the food (content). The dining room (your Next.js frontend) is built somewhere else entirely - in this case, deployed on Vercel - and receives the food through a delivery hatch (the WordPress REST API or WPGraphQL).
The result: your editors still use the familiar WordPress admin panel to write posts. But your visitors experience a blazing-fast modern website with 95+ PageSpeed scores.
The Architecture Explained
WordPress Backend (PHP) Next.js Frontend (Vercel) ├── wp-admin (editors write here) ←→ /api/posts → fetch posts ├── MySQL database ├── /blog → ISR pages ├── WPGraphQL plugin ├── /[slug] → dynamic routes └── Hosted on: VPS, Kinsta, etc. └── Deployed on: Vercel (free)
The flow when a visitor loads your blog:
- Visitor requests
yourdomain.com/blog/my-post - Vercel serves the pre-built static HTML from its CDN (instant)
- When you publish a new post in WordPress, it sends a webhook to Vercel
- Vercel rebuilds just that page (Incremental Static Regeneration)
What You Need Before Starting
- A WordPress installation - hosted on any server (not Vercel). Options: Cloudways, Kinsta, SiteGround, or a self-hosted VPS. Even a free Fly.io instance works.
- WPGraphQL plugin installed on your WordPress site (free)
- Node.js 18+ installed on your local machine
- A Vercel account - free at vercel.com
- A GitHub account - to connect your code repo to Vercel
Step-by-Step Deployment Guide
-
Install WPGraphQL on Your WordPress Site
In your WordPress admin panel, go to Plugins → Add New → search "WPGraphQL" → install and activate. This turns your WordPress site into a GraphQL API that Next.js can query. Test it by visiting:
https://yourwordpress.com/graphql -
Clone the Official WordPress + Next.js Starter
Vercel provides an official starter template. Run this in your terminal:
npx create-next-app --example cms-wordpress my-wp-sitethencd my-wp-site -
Configure Your Environment Variables
Copy the example file:
cp .env.local.example .env.local- then open it and add your WordPress URL:WORDPRESS_API_URL=https://yourwordpress.com/graphql -
Run Locally to Test
Run
npm installthennpm run devand openhttp://localhost:3000. You should see your WordPress posts rendered in the Next.js frontend. If you can see your blog posts, the connection is working. -
Push to GitHub
Initialise a git repo, commit your code, and push to GitHub. Vercel needs your code on GitHub to trigger automatic deployments on every push.
-
Deploy to Vercel
Go to vercel.com/new, import your GitHub repository, add your
WORDPRESS_API_URLenvironment variable, and click Deploy. Vercel auto-detects Next.js - no configuration needed. Your site goes live in under 2 minutes.
The headless WordPress + Next.js + Vercel stack is the modern standard for fast, scalable sites · Photo: Pexels
Environment Variables in Vercel Dashboard
After deploying, add any additional environment variables in Vercel:
- Go to your project in Vercel Dashboard
- Click "Settings" → "Environment Variables"
- Add
WORDPRESS_API_URLfor Production, Preview, and Development - Redeploy for changes to take effect
Setting Up On-Demand Revalidation (Auto-Update When You Publish)
By default, Next.js will regenerate pages on a schedule (ISR). For instant updates when you publish a new WordPress post, set up a webhook:
- Create a
WORDPRESS_PREVIEW_SECRETin your.env.local(any random string) - In WordPress admin: Settings → WPGraphQL → Webhooks → add your Vercel revalidation URL
- Vercel URL format:
https://yoursite.vercel.app/api/revalidate?secret=YOUR_SECRET
Now every time you publish a post in WordPress, Vercel instantly rebuilds that page.
Alternative: Serverless WordPress with Vercel Functions (Experimental)
For advanced users, there's an experimental setup where WordPress PHP runs as a serverless function. The Serverless WordPress project packages WordPress into a Lambda-compatible format. This is not production-ready for most use cases, but it's an interesting option for simple blogs.
WordPress Hosting Options Compared
| Option | WordPress Backend | Frontend Hosting | Monthly Cost |
|---|---|---|---|
| Traditional WP | SiteGround / Bluehost | Same server | $5–20/month |
| Managed WP | Kinsta / WP Engine | Same server (CDN) | $35–100/month |
| Headless (our setup) | Any VPS or managed host | Vercel (free) | $10–30/month (backend only) |
| WordPress.com | WordPress.com hosted | Same | Free–$45/month |
This site itself is built with Next.js deployed on Vercel - the same stack. Read our guide on MCP and AI agents for more on how we automate content workflows. See our Complete SEO Guide 2026 to make sure your new fast site actually ranks. And for managing your content workflows with AI, our Claude Console guide shows you how to automate WordPress content generation at scale.
References & Further Reading
Need Help Building or Migrating Your WordPress Site?
At Mayank Digital Labs, we build fast, modern websites using Next.js, Vercel, and headless CMS setups - so your site loads instantly everywhere in the world.
No commitment. Just a 30-minute call to see how we can help.
The WordPress Vercel deployment workflow described in this guide is the most reliable way to get the speed benefits of Vercel with the content management power of WordPress. Whether you are doing a full headless WordPress Vercel setup for the first time or migrating an existing site, the WordPress Next.js Vercel stack delivers faster load times, better Core Web Vitals, and happier users - all while keeping your editors in the familiar WordPress dashboard they already know.
Frequently Asked Questions
Can you deploy WordPress directly on Vercel?
Vercel does not support PHP, so WordPress cannot run directly on it. The best approach is to use WordPress as a headless CMS and deploy a Next.js frontend on Vercel, connected via the WordPress REST API or WPGraphQL.
What is headless WordPress?
Headless WordPress means using WordPress only as the content management backend - editors still write posts in WordPress - but the frontend website is built with Next.js and served from Vercel's fast CDN. Visitors get a much faster experience.
Is deploying WordPress on Vercel free?
Vercel's frontend hosting is free for personal and small projects. You still need a separate server for the WordPress PHP backend - options include a VPS ($5–10/month) or managed WordPress hosting ($14–35/month).
Why use Vercel instead of traditional WordPress hosting?
Vercel deploys your frontend globally on a CDN with automatic HTTPS and instant page loads. Traditional WordPress hosting serves every request from one server. The result is dramatically faster performance and better Google Core Web Vitals scores.
What plugin do I need to connect WordPress to Next.js on Vercel?
You need the WPGraphQL plugin installed on your WordPress site. It turns your WordPress installation into a GraphQL API that your Next.js frontend can query to fetch posts, pages, and custom content types - making the whole headless setup possible.