Skip to content

How to build a WordPress drop down list

A WordPress drop down list is not one feature. The phrase covers navigation submenus, form select fields, WooCommerce variation pickers and catalog sorting, and each of those is owned by a different system. Work out which one you have before you change anything, because applying the right fix in the wrong place is the most common way this turns into an afternoon.

On this page
  1. Which of the five dropdowns are you looking at
  2. Build a submenu on a classic theme
  3. Build a submenu on a block theme
  4. Add a select field to a form without losing the answer
  5. Fix a WooCommerce dropdown that is empty or missing
  6. The dropdown exists but nobody can see it
  7. Make the dropdown work without a mouse
  8. Frequently asked questions

Key takeaways

  • Classic themes build submenus in Appearance then Menus. Block themes use the Navigation block. WordPress.org’s documentation says 5.9 was the last version to include the Appearance Menus screen for all sites by default.
  • A menu that looks complete in the admin but shows nothing on the front end is usually not assigned to a theme location, or the header template has no Navigation block.
  • If the submenu is in the page source but invisible, the cause is almost always CSS: z-index, overflow or height on a parent, or a leftover visibility rule.
  • An empty WooCommerce variation dropdown means the attribute was never ticked Used for variations, or variations were never generated.
  • A select needs a real label tied to it with for and id. Placeholder text that reads Select… is not a label, and it should never submit as a valid answer.

The Services item in your header will not open on a phone. Or a quote form keeps arriving with an empty “Choose a service” value. Or the size picker on a product page renders, but there is nothing inside it. All three get searched as the same thing: a WordPress drop down list.

They are not the same thing. WordPress has no single dropdown feature. The phrase covers at least five surfaces, each owned by a different system, each with its own cause when it stops working. Picking the wrong one and fixing that instead is the expensive mistake here.

Which of the five dropdowns are you looking at

What you seeWhat owns itWhere you change it
Submenu under a header linkWordPress menus plus your themeAppearance then Menus, or the Navigation block
Select field in a contact or booking formYour form pluginThe plugin’s form builder or form-tag
Size or colour picker on a product pageWooCommerce variationsProduct data then Attributes and Variations
“Sort by” box on the shop pageWooCommerce plus the theme templateTheme output of the catalog sorting hook
Filter or picker inside wp-adminCore or a pluginCode: a metabox, a filter callback, a walker

Before any of that, answer one question: is the site on a classic theme or a block theme. Classic themes store navigation in the Menus screen. Block themes store it in a template, edited through the Site Editor. If you are unsure which you have, open the Appearance menu and look at what is in it, the same test used for editing a WordPress theme safely: a Customize item points to classic, an Editor item points to block. WordPress.org’s documentation notes that 5.9 was the last version to include the Appearance Menus screen for all sites by default, and that block themes in 6.0 and later manage navigation through the Navigation block.

Editing the wrong screen for your theme type is the top reason people say “I saved it and nothing changed”.

Build a submenu on a classic theme

Go to Appearance then Menus. You need an editor or administrator account; no file access is involved.

  1. Create a menu, or select the existing one from the dropdown at the top.
  2. Add the parent item first, for example the Services page.
  3. Add the child items below it.
  4. Drag each child slightly to the right, under the parent. The item label changes to “sub item”. That indentation is the dropdown.
  5. In Menu Settings, tick a display location such as Primary Menu. A menu with no location ticked renders nowhere.
  6. Save Menu, then load the front end in a logged-out window and check desktop and mobile.

A correct result looks like this: hovering or tapping the parent reveals the children, and the parent still links to its own page if it has one. If the admin screen shows your items but the front end shows nothing, go back to step 5 first. Missing location assignment is the single most frequent cause, and it takes a minute to rule out.

WordPress Appearance Menus screen with a nested sub item forming a drop down list
On the WordPress Menus screen, indenting items like ‘Contact Us’ and ‘Services’ beneath a parent item creates a clear visual structure for a dropdown submenu. · Source: wordpress.org

Build a submenu on a block theme

Open Appearance then Editor, then Patterns or Templates, and open the template part that holds your header. Select the Navigation block inside it. The block’s documentation on WordPress.org covers creating a menu, selecting an existing one, and adding submenu items.

  1. Select the link you want as the parent.
  2. Use the block toolbar option to add a submenu, then type or search for the child pages.
  3. In the Navigation block’s settings, check whether submenus open on hover or on click. Click is the safer default, because touch devices cannot hover.
  4. Save, and confirm the change on the live header rather than in the editor preview.

The block-theme version of “nothing happened” is usually one of two things: the header template part contains no Navigation block at all, or the block points at a different menu than the one you edited. Both are visible in the Site Editor in about thirty seconds. The same template-part logic applies lower down the page, which is why editing the WordPress footer follows the same route.

Resist the urge to create a second menu when the first one will not appear. Duplicate menus are how a site ends up with different navigation on different templates.

Navigation block selected in the WordPress Site Editor with submenu items
The Site Editor’s List View reveals how submenu items are neatly nested within the Navigation block, making it simple to manage your header’s dropdowns. · Source: wordpress.org

Add a select field to a form without losing the answer

Form dropdowns come from the form plugin, not from WordPress. In a builder like WPForms or Forminator you drag in a Select field, type the options, and set required or multi-select in the field settings. Contact Form 7 does the same job with a form-tag; its documentation covers drop-down menus alongside checkboxes and radio buttons, and the starred version of a tag makes the field required:

[select* service "Web design" "SEO" "Maintenance"]

Four decisions matter more than the markup:

  • Who maintains the list. If office staff need to rename an option next quarter, keep it in the plugin’s interface. Hard-coded options save nothing if every edit becomes a developer task.
  • How long the list is. A fifty-item select is a scrolling problem. Split it into two dependent selects (category, then subcategory), or use radio buttons when there are five or fewer choices.
  • What the empty state submits. A first option reading “Select…” must not be an acceptable value. Mark the field required so it cannot be submitted blank, otherwise that placeholder becomes a row in your reporting.
  • Where the value lands. Send a test entry and check the notification email and the saved entry. A dropdown that works on screen and maps to the wrong field downstream still costs you the lead.

Dynamic options, pulled from products, posts or taxonomy terms, are possible but not from core alone. Custom fields with a select, a form plugin’s dynamic choices feature, or a small function that turns terms into options all work. The tradeoff is worth naming: business logic built around a niche plugin is hard to move if that plugin stops being maintained.

Fix a WooCommerce dropdown that is empty or missing

Variation pickers and the shop’s sort box fail for different reasons.

An empty variation dropdown. WooCommerce’s documentation describes variable products as a product type offering a set of variations with their own price, stock and image. The chain has to be complete: set the product type to Variable product, add the attribute with its values, tick Used for variations on that attribute, save, then generate the variations and give each one a price. A select can render and still be empty when the attribute exists but was never marked for variations, or when variations were never created.

A missing “Sort by” box. That control comes from the theme calling WooCommerce’s catalog ordering hook, woocommerce_catalog_orderby. Themes that build their own shop templates sometimes remove it. Restoring it is a template change, which means a child theme and file access, not a settings toggle. Check the theme’s own options first; some expose sorting as a checkbox.

A picker nobody uses. On mobile, a variation dropdown below the Add to cart button gets missed, and you hear about it as “the item is out of stock”. Put selectors above the button, label them explicitly (“Select size”), and show a clear message when nothing is chosen.

WooCommerce attribute settings with the Used for variations checkbox ticked
Ensure attributes are marked ‘Used for variations’ within the product data settings to populate product dropdowns correctly. · Source: woocommerce.com

The dropdown exists but nobody can see it

Work down this order. It is the sequence that resolves these fastest, because each step is cheaper than the one after it.

  1. Assignment. Classic: is a display location ticked. Block: does the header template actually contain a Navigation block, pointing at the right menu.
  2. CSS. Right-click the parent item and inspect. If the submenu is in the page source but not on screen, it is a style problem, not a broken feature. The usual four: z-index too low so the submenu sits behind a sticky header, slider or the admin bar; overflow: hidden or a fixed height on a parent container clipping it; a visibility: hidden or display: none rule that never gets reversed; a gap between the parent and the submenu so the dropdown closes as the pointer travels toward it.
  3. JavaScript. Open the browser console on the front end. Uncaught TypeError or ReferenceError: $ is not defined means the script that opens the menu died. WordPress loads jQuery in no-conflict mode, so custom scripts need wrapping:
    jQuery(document).ready(function($) {
      // menu code
    });
  4. Conflicts. Deactivate plugins, reproduce, re-enable one at a time, then switch to a default theme such as Twenty Twenty-Five to isolate theme scripts. Do it on staging, or in a troubleshooting mode that only affects your own session, so visitors do not watch you work. The same method covers most cases where WordPress plugins are not working.
  5. Caching. Purge every layer you have: the caching plugin, the host’s server cache, the CDN. Then turn off JS and CSS minification and combination, or exclude the menu’s scripts from them. Stale assets make correct fixes look like they did nothing.
  6. Rebuild. After a migration or a repeated menu import, items can exist in the admin and never render. Delete that menu, rebuild it by hand, reassign the location.

One rule runs through all six: change one thing at a time. Disable five plugins at once and the symptom goes away without telling you what caused it.

If you would rather hand the diagnosis over, SiteSelf takes a report like “the Services submenu does not open on mobile” through chat, does the work on the live site, and reports what it changed and what it checked, which is the kind of request covered by WordPress bug fixes through chat.

When to stop and get help

Stop before you edit header.php or a wp_nav_menu() call in a parent theme, because the next theme update overwrites it. Stop if the site runs a theme header, a page builder header and a mega menu plugin at once; that is three systems competing for the same navigation, and the fix is choosing one and removing the others, which is a project rather than a tweak. Stop if a copied CSS or JS snippet changes behaviour you do not understand.

Make the dropdown work without a mouse

A dropdown that only opens on hover is finished for mouse users and broken for everyone else. Keyboard users cannot hover. Touch users cannot either.

For forms, the rule is short: every select gets a visible label associated with it through for and id, with unique IDs on the page. W3C’s WAI tutorial on labeling controls covers that association. Placeholder text inside the select is not a label, no matter how well it reads.

For navigation, W3C’s WAI tutorial on fly-out menus covers making submenus that open on hover also work from the keyboard. Test it yourself in two minutes: put the mouse aside, press Tab through the header, confirm every top-level item shows a visible focus outline, confirm Enter or Space opens the submenu, and confirm focus never vanishes behind a sticky header or an off-canvas panel.

Where you have a choice, use the native <select>. It is announced correctly by screen readers, it behaves the way each phone expects, and it survives plugin updates that break custom widgets. A custom dropdown with search, swatches or grouped options has to earn its place by adding something the native element cannot do, and then it owes you keyboard operation, focus management and correct roles and states.

Frequently asked questions

How do I put a dropdown in a sidebar or footer menu?

Same mechanism, different location. On a classic theme, nest the child items and tick the footer or sidebar display location in Menu Settings. On a block theme, open the footer template part and add or edit the Navigation block there. Some themes style submenus only in the header, so a footer dropdown can render as a flat list even when the structure is correct.

Can form dropdown options come from my products or posts automatically?

Not from WordPress core. The routes people use are a custom fields plugin with a select managed in the admin, a form plugin’s dynamic choices feature, or a small function that converts taxonomy terms or a post type into options. Weigh it against the maintenance you are avoiding: a list that changes weekly is worth automating, a list of five services is not.

Why does the menu work when I am logged in but not for visitors?

Almost always caching or optimisation. Logged-in users typically bypass the page cache, so you see the new markup while visitors get the old one. Purge the plugin cache, the host cache and the CDN, then check whether JS combination or defer is reordering the menu script.

Do I need a mega menu plugin?

Only when the requirement genuinely exceeds core: multi-column layouts with images, or marketing staff who need to edit promotional panels themselves. Plain parent and child items in the built-in menu system cover most sites, and they break far less often after an update. If you do add one, remove whatever else was controlling the header.

Can I make a dropdown searchable, so typing filters the options?

That is a different UI pattern, built with JavaScript rather than a plain select, and usually supplied by a plugin or a library. It carries the full accessibility cost of a custom widget. If a list is long enough to need search, consider whether two dependent dropdowns or a different field type would serve people better.

The dropdown broke right after a theme update. What happened?

Two likely causes. Template edits made directly in the parent theme were overwritten, which is why menu code belongs in a child theme. Or the update changed menu locations and your menu lost its assignment. Check Appearance then Menus, or the Navigation block in the header template, before touching anything else.

Give your WordPress site its first task.

Connect the site you already have, add your agent to Slack or Telegram, and tell it what you need.

Connect your site

Start with 500 free credits. No credit card needed.