This section explains whether Shifter supports the WP REST API.
What Is the WordPress REST API?
The WP REST API is a programmable interface for interacting with WordPress and its data.
Shifter Environments and WP REST API Support
Shifter offers two environments, and WP REST API support varies between them.
- Container Environment: Use of the WP REST API is supported.
- Production Environment: Use of the WP REST API is not supported.
Why the WP REST API Is Not Available in the Production Environment
Since WordPress is not running in the production environment, the WP REST API is not available. Shifter converts WordPress into a static site, and once the conversion is complete, the software necessary to interact with PHP or the API no longer exists.
Alternative: WP Serverless API
As an alternative when the WP REST API is unavailable in Shifter’s production environment, the WP Serverless API plugin is available.
- Overview: A WordPress plugin designed as a read-only WP REST API.
- How it works: It queries the REST API and saves the output as static files.
The
The `db.json`
file is created when the plugin is activated.- Version 0.2.0 and later: The storage location has moved from /wp-content/uploads/wp-sls-api/db.json to /wp-content/wp-sls-api/db.json. This resolves the conflict with Shifter Media CDN.
Further Information
For more details, please see the GitHub project: