Get Startedin Minutes
Download the starter template and WordPress plugin, follow the quick setup guide, and you'll have a lightning-fast headless WordPress site running in no time.
What You Need
Download both components to get started. The starter template runs your frontend, and the plugin connects WordPress.
FlatWP Starter
Next.js 15 frontend with all components, blocks, and configurations ready to go.
WordPress Plugin
Connect your WordPress site with GraphQL extensions, preview support, and revalidation webhooks.
System Requirements
Make sure you have these installed before getting started.
Frontend
- Node.js20.0+
- pnpm8.0+
- GitAny
WordPress
- WordPress6.0+
- PHP7.4+
- WPGraphQL Plugin1.14+
- ACF ProOptional
Setup Guide
Follow these steps to get FlatWP running in just a few minutes.
Clone the Starter Repository
Clone the FlatWP starter template from GitHub and navigate to the project directory.
# Clone the repository
git clone https://github.com/flatwp/flatwp-starter.git my-site
cd my-siteInstall Dependencies
Install all Node.js dependencies using pnpm. This includes Next.js, React, and all UI components.
# Install with pnpm (required)
pnpm install
# Or use the setup script
pnpm setupConfigure WordPress Connection
Create an environment file and add your WordPress GraphQL endpoint URL.
# Create environment file
cp .env.example .env.local
# Edit .env.local with your WordPress URL
NEXT_PUBLIC_WORDPRESS_API_URL=https://your-wordpress-site.com/graphql
FLATWP_SECRET=your-secure-random-secretInstall WordPress Plugin
Upload and activate the FlatWP WordPress Connector plugin in your WordPress admin.
# Download the plugin from GitHub releases
# Or use WP-CLI:
wp plugin install https://github.com/flatwp/flatwp-plugin/releases/latest/download/flatwp-wordpress-connector.zip --activateInstall WPGraphQL
The WPGraphQL plugin is required to expose your WordPress content via GraphQL.
# Install via WP-CLI
wp plugin install wp-graphql --activate
# Or download from wordpress.org/plugins/wp-graphqlStart Development Server
Run the development server and open your site in the browser.
# Start the development server
pnpm dev
# Open http://localhost:3010 in your browserConfigure WordPress
Additional WordPress configuration for optimal FlatWP integration.
FlatWP Plugin Settings
After activating the plugin, configure these settings in Settings → FlatWP
- Frontend URL: Your Next.js site URL (e.g., https://your-site.com)
- Shared Secret: Same value as FLATWP_SECRET in your .env.local
- Enable Preview: Toggle preview support for drafts
- Revalidation Webhook: Auto-configured, triggers ISR on content updates
Permalink Settings
Configure permalinks for clean URLs that match your Next.js routes.
# Recommended permalink structure
Settings → Permalinks → Post name
https://your-site.com/sample-post/
# Or custom structure for blogs
/blog/%postname%/WPGraphQL Settings
Verify WPGraphQL is working by visiting the GraphQL IDE.
# Test your GraphQL endpoint
curl -X POST \
https://your-wordpress-site.com/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ generalSettings { title } }"}'
# Expected response:
# {"data":{"generalSettings":{"title":"Your Site Title"}}}What's Next?
You're all set! Here are some resources to help you build amazing things.
Need Help Getting Started?
Join our community on GitHub Discussions or check out the documentation for detailed guides and troubleshooting.