Releases: 9d8dev/next-wp
Releases · 9d8dev/next-wp
plugin-v1
next-revalidate plugin
Next.js WordPress Revalidation Plugin
This plugin enables automatic revalidation of your Next.js site when content is changed in WordPress.
Installation
- Upload the
next-revalidate.zip
file through the WordPress admin plugin installer, or - Extract the
next-revalidate
folder to your/wp-content/plugins/
directory - Activate the plugin through the WordPress admin interface
- Go to Settings > Next.js Revalidation to configure your settings
Configuration
1. WordPress Plugin Settings
After installing and activating the plugin:
- Go to Settings > Next.js Revalidation in your WordPress admin
- Enter your Next.js site URL (without trailing slash)
- Create a secure webhook secret (a random string)
- Save your settings
2. Next.js Environment Variables
Add the webhook secret to your Next.js environment variables:
# .env.local
WORDPRESS_WEBHOOK_SECRET="your-secret-key-here"
How It Works
- When content in WordPress is created, updated, or deleted, the plugin sends a webhook to your Next.js API route
- The webhook contains information about the content type (post, page, category, etc.) and ID
- The Next.js API validates the request using the secret and revalidates the appropriate cache tags
- Your Next.js site will fetch new content for the affected pages
Features
- Automatic revalidation for posts, pages, categories, tags, and media
- Manual revalidation option through the admin interface
- Secure webhook communication with your Next.js site
- Optional admin notifications for revalidation events
Troubleshooting
If revalidation isn't working:
- Check that your Next.js URL is correct in the plugin settings
- Verify the webhook secret matches in both WordPress and Next.js
- Check your server logs for any errors in the API route
- Enable notifications in the plugin settings to see revalidation status