Skip to content

goodthingsdev/wp-headless-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Headless Theme Screenshot

API Headless Theme

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.

Description

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.

Features

  • 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

Installation

  1. Copy the theme files into your wp-content/themes/api-headless-theme directory.
  2. Activate the theme in the WordPress admin dashboard.
  3. Update the frontend redirect URL in theme-config.php by setting the FRONTEND_APP_URL constant to match your frontend app.

Usage

  • 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.php via the FRONTEND_APP_URL constant.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Acknowledgments

About

A minimal WordPress theme designed for headless setups.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published