Add gutenberg blocks data into the post / page REST API endpoints.
As of April 2026, REST API blocks is a WordPress api plugin with 200 active installations and a 5/5 rating from 2 reviews. It has been downloaded 6.8K+ times in total. Requires WordPress 5.9+ and PHP 7.4+. Available on WordPress.org since 2021. Top alternative: WP Consent API.
A simple plugin to add block data in json format into the rest api. Once installed, there will be two new fields added to the rest api, has_blocks and blocks.
For example output.
"has_blocks": true,
"block_data": [
{
"blockName": "core/image",
"attrs": {
"url": "https://www.spacedmonkey.com/wp-content/uploads/2018/12/test-image.jpg",
"alt": "Terminal de aeropuerto",
"caption": "fsfsdfdsfdssfd",
"href": "https://www.spacedmonkey.com/test-image",
"rel": "noreferrer noopener",
"linkClass": "jonny-123",
"linkTarget": "_blank",
"id": 147355,
"width": 582,
"height": 327,
"linkDestination": "attachment"
},
"innerBlocks": [
],
"innerHTML": "\n<figure class=\"wp-block-image is-resized\"><a clas…
| WordPress | 5.9+ requiredTested up to 6.9.4 |
| PHP | 7.4+ required |
Breaking change!
The field in the REST API is changed from blocks to block_data.
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.