Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic.
HWP Previews is a robust and extensible WordPress plugin that centralizes all preview configurations into a user-friendly settings interface. It empowers site administrators and developers to tailor preview behaviors for each public post type independently, facilitating seamless headless or decoupled workflows. With HWP Previews, you can define dynamic URL templates, allow posts of all statuses to be used as parents, and extend functionality through flexible hooks and filters, ensuring a consistent and conflict-free preview experience across diverse environments.
In traditional WordPress, previewing content is straightforward: clicking the "Preview" button shows you a draft version of your post on the same WordPress site. However, in headless WordPress architectures, where the front-end is decoupled from WordPress, this simple mechanism breaks down. The front-end application lives on a different domain, knows nothing about WordPress authentication, and cannot automatically access unpublished content.
This fundamental architectural shift creates what we call the "preview problem" in headless WordPress. HWP Previews was created to bridge this gap, providing a centralized, framework-agnostic solution to preview management.
- Enable/Disable Previews: Turn preview functionality on or off for each public post type (including custom types).
- Custom URL Templates: Define preview URLs using placeholder tokens for dynamic content.
- Parent Status: Allow posts of all statuses to be used as parents within hierarchical post types.
- Highly Customizable: Extend core behavior with a comprehensive set of actions and filters.
- Faust Compatibility: The plugin is compatible with Faust.js and the FaustWP plugin.
Note
For Faust users, HWP Previews integrates seamlessly, automatically configuring settings to match Faust's preview system. This allows you to maintain your existing preview workflow without additional setup.
- WordPress 6.0+
- PHP 7.4+
You can get the latest release here - https://github.com/wpengine/hwptoolkit/releases/latest/download/hwp-previews.zip
You can also download it from our release page - https://github.com/wpengine/hwptoolkit/releases
To install, you need to follow our guide here to install the plugin via composer - https://github.com/wpengine/hwptoolkit/blob/main/docs/how-to/install-toolkit-plugins/index.md
Once you have the composer repository setup, please run composer req wpengine/hwp-previews:* to install the plugin.
For detailed usage instructions, developer references, and examples, visit our comprehensive documentation:
See Testing.md for details on how to test the plugin.
By default, HWP Previews preserves all settings when the plugin is deactivated to prevent accidental data loss.
If you would like to remove all plugin settings and data, you must set the PHP constant before you uninstall the plugin:
define( 'HWP_PREVIEWS_UNINSTALL_PLUGIN', true );You can add this constant to your wp-config.php file if you want to enable automatic cleanup during uninstallation.
Click to expand screenshots
Preview settings for a custom post type.
Preview button in the WordPress editor.
Preview loaded inside the WordPress editor using an iframe.
WP GPL 2


