---
id: gk-block-mcp-block-normalize
title: "Filter - gk/block-mcp/block/normalize"
sidebar_label: "gk/block-mcp/block/normalize"
tags:
  - "2.1.0"
---

# Filter: gk/block-mcp/block/normalize

Filters a single block on the write path so invalid markup can be repaired before it is serialized into post_content.

Write-side mirror of the read-side `gk/block-mcp/block/format` hook. A normalizer receives the block in WP-internal shape (`blockName`, `attrs`, `innerHTML`, `innerContent`, `innerBlocks`) plus its name, acts only on the block(s) it understands, and returns the same shape. It must not change the block's child count.

## Parameters

| Name | Type | Description |
|------|------|-------------|
| $block | `array` | The block being normalized. |
| $block_name | `string` | The block's name. |

### Since

- 2.1.0

### Source

Defined in `wordpress-plugin/gk-block-mcp/includes/class-block-normalizer.php` at line 85

