A minimal WordPress theme designed for headless setups. Disables all frontend rendering and features, exposing only the WordPress REST API for use with external frontend applications.
This theme is optimized for performance, security, and API-only access. All frontend requests are redirected to your external frontend app, and unnecessary WordPress features are disabled for a lean, secure, and efficient headless CMS experience.
- Disables all frontend scripts, styles, and shortcodes
- Redirects all non-API, non-admin requests to your frontend app
- Enables CORS for REST API
- Disables feeds, emojis, embeds, XML-RPC, and comments
- Security enhancements for user enumeration and pingbacks
- Copy the theme files into your
wp-content/themes/api-headless-themedirectory. - Activate the theme in the WordPress admin dashboard.
- Update the frontend redirect URL in
theme-config.phpby setting theFRONTEND_APP_URLconstant to match your frontend app.
- Use the WordPress admin to manage content as usual.
- Access all content via the WordPress REST API endpoints (e.g.,
/wp-json/wp/v2/posts). - All frontend requests will be redirected to the URL specified in
theme-config.phpvia theFRONTEND_APP_URLconstant.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT
