Get Raw Block Content
wp_get_raw_contentFetch raw Gutenberg block markup for a page or post to inspect the editable source, transform content, and then write changes back via the WordPress REST API.
Instructions
Read a page/post's RAW Gutenberg block markup (comment-delimited blocks), via core REST with context=edit. This is the editable source that wp_get_page/wp_get_post strip away. Use to inspect and transform page content, then write it back with wp_update_page. Requires admin.
Args:
id (number): page/post ID.
type ('page' | 'post'): default 'page'.
response_format (enum): markdown | json.
Returns: { id, title, slug, content } where content is the raw block markup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page or post ID. | |
| type | No | Content type. Default 'page'. | page |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |