---
title: "lzb/show_admin_menu"
description: "PHP filter `lzb/show_admin_menu` of the Lazy Blocks WordPress plugin."
url: "https://www.lazyblocks.com/docs/php-filters/lzb-show_admin_menu/"
lastUpdated: 2026-09-09
source: "php-filters/lzb-show_admin_menu.mdx"
---
# lzb/show_admin_menu

Takes the Lazy Blocks item out of the admin sidebar, which is what handing a finished site to a client without inviting them to edit its blocks takes.

The default is `true`. Returning `false` calls `remove_menu_page( 'edit.php?post_type=lazyblocks' )` on `admin_menu` at priority 12. That hides the link and nothing else. The screens stay reachable by URL and the `edit_lazyblocks` capability still governs who may open them, so this is tidiness rather than a permission boundary.

## Attributes

| Name    | Type        | Description                                 |
| ------- | ----------- | ------------------------------------------- |
| `$show` | **Boolean** | show the admin menu item, `true` by default |

## Usage

```php title="PHP"
function my_lzb_show_admin_menu( $show ) {
  // Only the developer account keeps the menu item.
  return current_user_can( 'manage_options' ) && 'dev@example.com' === wp_get_current_user()->user_email;
}

add_filter( 'lzb/show_admin_menu', 'my_lzb_show_admin_menu' );
```

```php title="PHP"
// Hide it from everyone.
add_filter( 'lzb/show_admin_menu', '__return_false' );
```

Register the filter before `admin_menu` runs at priority 12, which any plugin or `functions.php` load does. Only the administrator role has `edit_lazyblocks` out of the box, so editors, authors and contributors never see the menu item in the first place and this filter is aimed at administrators. To actually keep somebody out of the block builder, remove that capability from their role instead of hiding the link.

## 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
