Title: remove_serialized_parent_block
Published: July 16, 2024
Last modified: February 24, 2026

---

# remove_serialized_parent_block( string $serialized_block ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Accepts the serialized markup of a block and its inner blocks, and returns serialized
markup of the inner blocks.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#parameters)󠁿

 `$serialized_block`stringrequired

The serialized markup of a block and its inner blocks.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#return)󠁿

 string The serialized markup of the inner blocks.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#source)󠁿

    ```php
    function remove_serialized_parent_block( $serialized_block ) {
    	$start = strpos( $serialized_block, '-->' ) + strlen( '-->' );
    	$end   = strrpos( $serialized_block, '<!--' );
    	return substr( $serialized_block, $start, $end - $start );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/blocks.php#L1318)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/blocks.php#L1318-L1322)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#related)󠁿

| Used by | Description | 
| [apply_block_hooks_to_content_from_post_object()](https://developer.wordpress.org/reference/functions/apply_block_hooks_to_content_from_post_object/)`wp-includes/blocks.php` |

Run the Block Hooks algorithm on a post object’s content.

  | 
| [update_ignored_hooked_blocks_postmeta()](https://developer.wordpress.org/reference/functions/update_ignored_hooked_blocks_postmeta/)`wp-includes/blocks.php` |

Updates the wp_postmeta with the list of ignored hooked blocks where the inner blocks are stored as post content.

  | 
| [inject_ignored_hooked_blocks_metadata_attributes()](https://developer.wordpress.org/reference/functions/inject_ignored_hooked_blocks_metadata_attributes/)`wp-includes/block-template-utils.php` |

Inject ignoredHookedBlocks metadata attributes into a template or template part.

  | 
| [_build_block_template_result_from_file()](https://developer.wordpress.org/reference/functions/_build_block_template_result_from_file/)`wp-includes/block-template-utils.php` |

Builds a unified template object based on a theme file.

  | 
| [_build_block_template_result_from_post()](https://developer.wordpress.org/reference/functions/_build_block_template_result_from_post/)`wp-includes/block-template-utils.php` |

Builds a unified template object based a post Object.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/remove_serialized_parent_block/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.6.0](https://developer.wordpress.org/reference/since/6.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fremove_serialized_parent_block%2F)
before being able to contribute a note or feedback.