Auto Submenu

NEW: ASM now provides support for Full Site Editing with the Gutenberg Block Editor

The default custom menu in WordPress only allows checking the “Automatically add new top-level pages” (Appearance > Menus) or adding a Navigation block with all pages and all child pages (Appearance > Editor).

With Auto Submenu you get extra functionality to automatically include child pages into the menu.

This plugin is available as Free and as Premium version.


This plugin can be found in the Plugin Directory. You can install it via the usual WordPress Plugin route, just search for “Auto Submenu”.


Premium: Pricing in 2024

  • Single-site: 1 year, 1 URL 10,-
  • Developer pack: 1 year, 10 URLs 80,-
  • Payment in Euro’s via Stripe or bank transfer (IBAN) to The Netherlands
  • Buy a license

You’ll receive an automatic e-mail a month before your license expires.

Premium: Features

When you go Premium, you get the following extra features:

  1. Allow expanding unlimited nesting depth (-1 for unlimited)
  2. Extra wildcards, see below.
  3. Build a custom HTML structure for your menu items (no longer only flat text)
  4. More fine-grained control over how the posts are ordered. (Separate selection of Order By and Ascending/Descending, more fields to order by)
  5. Automatic updates

Premium: Support

Going Premium means you can contact me directly via e-mail for support and I’ll help you out. Below, you can read what I’ll help you with.

  • Bugs: The plugin crashes, doesn’t expand the posts or doesn’t show the correct output somehow.
  • Configuration support: How can I get the menu to show X…?
  • Theme support: Support is provided with free WordPress themes. Issues should be reproducible in a free theme. (I cannot provide support for paid WordPress themes or plugins at this moment.)
  • Plugin support: Support is provided with free WordPress plugins, provided that these plugins do not affect the menu. If another plugin also edits the menu, I cannot guarantee that my plugin will work properly. (Important note: Conflicts will surely arise if two plugins are tasked with editing your menu. Therefore, you should first check that the Free version of my plugin works as intended, before you purchase the Premium version.)
  • Please note: This plugin is delivered as-is. Going Premium does not mean that your feature requests will automatically be honored. That being said, feel free to send me a message, perhaps your request can easily be achieved.

Premium: Extra wildcards

  • %post_featured_image_url
  • %post_featured_image (insers an HTML ‘img’ tag with the featured image or nothing if there is none)
  • %post_featured_image_thumb_url
  • %post_featured_image_thumb (inserts an HTML ‘img’ tag with the featured image thumbnail or nothing if there is none)
  • %post_excerpt
  • %post_url
  • %post_status
  • %post_modified
  • %post_modified()
  • %post_modified(<your formatting here>)
  • %post_modified_gmt
  • %post_modified_gmt()
  • %post_modified_gmt(<your formatting here>)
  • %post_comment_count
  • wildcards for custom fields, like %post_my_field, where ‘my field’ or ‘my_field’ is a custom field

Premium: Screenshots

Via Appearance > Menus:

Via Appearance > Customize:

Via Appearance > Editor:

Known limitations


The plugin is potentially very expensive, especially when you decide to build your entire menu out of nothing but pages with subpages.

The solution would be to cache the menu using transients, as reported here

> $my_cached_menu = get_transient( 'my_cached_menu');
> if( $my_cached_menu === false )
> {
> $my_cached_menu = wp_nav_menu( ... );
> set_transient( "my_cached_menu_", $my_cached_menu, YEAR_IN_SECONDS );
> }
> echo $my_cached_menu;

Conflicts with plugins/themes

Problem: “I can’t see what effect it has had. Nothing has changed (not that I can see) in the Appearance > Menu page. Just like before.”

If you are using a recent version of Auto Submenu and an updated version of WordPress, the problem can only occur due to your theme or other plugins conflicting with Auto Submenu. Please disable all themes and plugins except ASM; verify that the ASM fields show; enable other plugins and themes one by one to determine which plugin/theme conflicts with ASM.

Note: A theme must either call wp_nav_menu() or apply_filters( 'wp_nav_menu_objects', … ) for ASM to be triggered.

You should first check that the Free version of my plugin works as intended, before you purchase the Premium version