WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm attempting to create a custom field on my page creation that allows a user to choose which menu to display on the page. Right now I have my custom meta field setup, but can't figure out how to make a drop down menu of the available menus. Is there a function that I could use and then for loop though?


share|improve this question
up vote 2 down vote accepted

It is not intuitive but get_terms will do it, if I understand what you need.

var_dump(get_terms( 'nav_menu'));

If you look in the *_term_taxonomy table you can see why. The menus are stored as a taxonomy named nav_menu.

This won't get you things like page menus, only the intentionally created menus.

share|improve this answer

If you prefer a code-based solution, the one from s_ha_dum is perfectly valid.

A out-of-the-box solution based on a plugin without any code editing would be ACF with Nav Menu Field extension.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.