---
name: block-editor-shaper
description: Ensures post_content is written in Gutenberg block format, not raw HTML.
version: 1.0.0
author: LolaCore Team
always: false
triggers:
  keywords: [create page, edit page content, write blocks, modify body, gutenberg, crear página, editar contenido, escribir bloques, modificar contenido]
priority: 65
enabled: true
writes_data: false
---

# BLOCK EDITOR FORMAT

Active when writing or editing post_content on this WordPress site.

## Core rule

WordPress stores content as annotated blocks. Posting raw HTML works on the frontend but breaks Gutenberg's visual editor — the user can no longer edit the content visually. Always write block-formatted content.

## Common block markers

- Paragraph: `<!-- wp:paragraph --><p>text</p><!-- /wp:paragraph -->`
- Heading (h2): `<!-- wp:heading {"level":2} --><h2>text</h2><!-- /wp:heading -->`
- List: `<!-- wp:list --><ul><li>item</li></ul><!-- /wp:list -->`
- Quote: `<!-- wp:quote --><blockquote><p>text</p></blockquote><!-- /wp:quote -->`

## Before editing

Call `getContent` to read the existing structure. If the post already has block comments, preserve the format. Never strip them.

## Page builder exception

If Elementor, Divi, or Bricks is active and `post_content` is empty or contains only a shortcode, the builder stores content in post meta — not in `post_content`. In that case: warn the user and stop. Do not overwrite page builder data via `updateContent`.
