---
title: "lzb/block_render/allow_inner_blocks_wrapper"
description: "lzb/block_render/allow_inner_blocks_wrapper removes the div around inner blocks, for a block whose children must sit directly in a grid or flex container."
url: "https://www.lazyblocks.com/docs/php-filters/lzb-block_render-allow_inner_blocks_wrapper/"
lastUpdated: 2026-09-23
source: "php-filters/lzb-block_render-allow_inner_blocks_wrapper.mdx"
---
# lzb/block_render/allow_inner_blocks_wrapper

Drops the `<div>` Lazy Blocks puts around inner blocks, which a block whose children have to be direct descendants of a grid or a flex container needs.

The default is `true`. With the wrapper on, the inner content is placed inside a `<div>` whose class is taken from a `class` or `className` attribute on the `` tag in your template, falling back to `lazyblock-inner-blocks`. With it off, the inner content replaces `` exactly where it stands and no element is added. The filter runs on the front end only, so the editor keeps its own wrapper and the two views differ until you account for that in your CSS.

## Attributes

| Name                          | Type              | Description                              |
| ----------------------------- | ----------------- | ---------------------------------------- |
| `$allow_inner_blocks_wrapper` | **Boolean**       | render the wrapper, `true` by default    |
| `$attributes`                 | **Array**         | control values, as the template saw them |
| `$context`                    | **Array \| null** | block context from parent blocks         |

The block itself is not passed. Read its slug from `$attributes['lazyblock']['slug']`, or use the per-block variant below.

## Additional Filters

| Name                                              | Arguments                                            | Description    |
| ------------------------------------------------- | ---------------------------------------------------- | -------------- |
| `lazyblock/BLOCK_SLUG/allow_inner_blocks_wrapper` | `$allow_inner_blocks_wrapper, $attributes, $context` | specific block |

## Usage

```php title="PHP"
function my_lzb_allow_inner_blocks_wrapper( $allow, $attributes, $context ) {
  // The columns block is a CSS grid, so its children have to be direct
  // descendants and the extra div would break the layout.
  if ( 'lazyblock/columns' === $attributes['lazyblock']['slug'] ) {
    return false;
  }

  return $allow;
}

add_filter( 'lzb/block_render/allow_inner_blocks_wrapper', 'my_lzb_allow_inner_blocks_wrapper', 10, 3 );
```

```php title="PHP"
// Drop the wrapper for one block, without a callback.
add_filter( 'lazyblock/columns/allow_inner_blocks_wrapper', '__return_false' );
```

The return value is used as a boolean, so anything truthy keeps the wrapper. Turning it off for a block that has no inner content leaves `` replaced with an empty string rather than an empty `<div>`, which changes what a `:empty` or `:first-child` selector matches.

See [Inner Blocks Wrapper](https://www.lazyblocks.com/docs/blocks-code/php-callback/#inner-blocks-wrapper) for how the wrapper class is picked up from the template.

## Documentation Index
> Fetch the complete documentation index at: https://www.lazyblocks.com/llms.txt
> Fetch every page in a single file at: https://www.lazyblocks.com/llms-full.txt
