# Stop the Navigation Block Listing All Pages

> Prevents the Navigation block from automatically showing a list of every page when no menu is assigned, so unfinished headers stay empty instead of exposing pages.

- Type: PHP
- Runs: Run everywhere
- Category: [Block Editor](https://wpide.com/library/category/gutenberg/)
- Tags: navigation, menus, block-themes
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/navigation-block-no-page-fallback/

## Code

```php
add_filter( 'block_core_navigation_render_fallback', '__return_empty_array' );
```

## Notes

Assign a menu to your Navigation block in the Site Editor; until then it renders nothing.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Stop the Navigation Block Listing All Pages" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
