Quickstart
Deploy a project in minutes with this quickstart guide.
WordPress hosting
Connect to an existing WordPress instance, or create a new WordPress site using any hosting provider such as WP Engine, DigitalOcean, or Kinsta. We recommend WP Engine as they have a great developer experience, reliable hosting and amazing support.
Pre-requisites
NextWP integrates with the NextWP Toolkit plugin on your WordPress site to enable features like preview mode and to retrieve additional data not included by default in the WP REST API, such as ACF options pages.
Create a new project
You can deploy a NextWP project to Netlify or Vercel with one click.
Or, create a new project using the create-nextwp-app
CLI tool to generate a starter project.
pnpx create-nextwp-app
Add to existing project
If you already have a Next.js project, you can install @nextwp/core
using your preferred package manager.
pnpm add @nextwp/core
Add Environment Variables
Properly configuring environment variables is crucial for enabling the NextWP to WordPress connection.
Generate an application password in WordPress. (Users > Your Profile > Application Passwords)
Make sure your NEXT_PREVIEW_SECRET
and REVALIDATE_SECRET_KEY
are also added in your NextWP Toolkit plugin settings.
Example .env.local
You can quickly copy these randomly generated example variables to your .env.local
.
.env.local
NEXT_SITE_URL=
NEXT_PUBLIC_WP_URL=
WP_APPLICATION_PASSWORD=
NEXT_PREVIEW_SECRET=
REVALIDATE_SECRET_KEY=
What's next?
Congratulations! You have successfully set up your Next.js site to connect with your WordPress CMS. Now, let's explore some next steps you can take: