◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Errors → Sub Menu Options Disappear Hovering
Fixed: sub-menu options disappear when hovering
A disappearing sub-menu can ruin the user experience on your WordPress site. If your visitors can’t access sub-menu links because they vanish too quickly—or don’t appear at all—it’s usually a CSS issue, a conflict with your theme or plugins, or a simple menu misconfiguration.
Let’s walk through the most effective ways to fix it.
Use dev tools to inspect the sub-menu CSS
The first step is to see what’s happening behind the scenes when you hover over a menu item.
- Open your website in Google Chrome or Firefox.
- Right-click on the menu item and choose Inspect. This will open the browser’s Developer Tools.
- Hover over the menu again and watch the HTML and CSS update in real time.
- Look for these common red flags in the CSS panel:
- display: none (this hides the sub-menu entirely)
- position: absolute or relative without proper offsets
- Margins that push the sub-menu out of view (like margin-top: 20px)
- Z-index values that are too low (causing the sub-menu to appear behind other elements)
You don’t need to change anything in Dev Tools yet—this is just to help identify what styles might be causing the problem.
1. Adjust margins and padding for better visibility
If the sub-menu is disappearing when you try to move your mouse to it, margins might be the issue. Here’s how to fix it:
- Go to Appearance > Customize > Additional CSS in your WordPress dashboard.
- Add this CSS to reduce unnecessary margins and add a bit of helpful padding:
ul.sub-menu {
margin-top: 0;
padding-top: 5px;
} - Margins create space outside of an element, which can cause the sub-menu to appear farther away and flicker off if the cursor leaves the main menu item. Padding adds space inside the element, which helps improve spacing without disrupting visibility.
If your theme uses a different class name (like .children or .dropdown-menu), replace .sub-menu with that instead.
3. Clear your browser cache and cookies
Outdated files in your browser cache can cause display issues even after you’ve fixed the CSS.
- In Chrome, press Ctrl+Shift+Del (or Command+Shift+Delete on Mac).
- Select Cached images and files and Cookies and other site data.
- Click Clear data.
- Reload your site and test the menu again.
You can also try using a different browser or private/incognito window to confirm whether the issue is browser-related.
4. Check for CSS and JavaScript conflicts
Some themes or plugins may be loading conflicting styles or scripts.
Step 1: Look for conflicting CSS
In your Developer Tools panel:
- Check if any rules are hiding sub-menus, like .sub-menu { display: none !important; }.
- If a display: none rule appears without a corresponding :hover override, the sub-menu won’t show.
You can fix this in Appearance > Customize > Additional CSS with a rule like:
.main-menu li:hover > .sub-menu {
display: block;
}
Step 2: Test for plugin or theme conflicts
To rule out a plugin conflict:
- Go to Plugins > Installed Plugins.
- Deactivate all plugins.
- Check if the sub-menu works correctly.
- Reactivate plugins one at a time and test the menu after each one.
To rule out a theme conflict:
- Go to Appearance > Themes.
- Activate a default theme like Twenty Twenty-Four.
- Test your menu again.
If the sub-menu works now, your original theme is likely the source of the problem.
5. Troubleshoot recent theme or plugin changes
If your sub-menu used to work fine, but started misbehaving after a recent update, the update may be the issue.
- Check Appearance > Themes and click Theme Details. The changelog might mention menu-related updates.
- Visit Plugins > Installed Plugins, and sort by Last Updated.
- Deactivate any recently updated plugins and check your menu.
If you use a staging site, test the update there first before rolling back or making changes on your live site.
6. Keep everything up to date
Outdated code can break or conflict with newer WordPress versions.
- Go to Dashboard > Updates.
- Make sure WordPress core, your theme, and all plugins are fully updated.
- If you’re not ready to update, consider using a child theme to override problem styles without losing changes during updates.
7. Use direct child selectors in your custom CSS
To avoid unintended styling or cascading issues, be specific in your CSS.
For example, use this:
.main-menu > li:hover > .sub-menu {
display: block;
}
Instead of this:
.main-menu li .sub-menu {
display: block;
}
Direct child selectors ensure that only the immediate sub-menu is affected—not deeper menu levels or unrelated styles.
8. Add a small delay using transition or JavaScript
Sometimes the sub-menu disappears too quickly because there’s no hover delay.
CSS transition example
.sub-menu {
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease-in;
position: absolute;
}
.main-menu li:hover > .sub-menu {
opacity: 1;
visibility: visible;
}
JavaScript-based delay (for advanced users)
If needed, use JavaScript to delay hiding the menu on mouseout. You’ll need to enqueue a small custom script or use a plugin that allows header/footer JS.
Next steps for fixing disappearing sub-menu items
Fixing a vanishing sub-menu usually comes down to small CSS tweaks or identifying a plugin/theme conflict. A few minutes in Dev Tools and the right inspection techniques go a long way.
If your sub-menu issues persist, try switching to a basic theme or building a test menu on a clean install to isolate the cause.
Ready to upgrade your WordPress experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy.
Don’t want to deal with server management and maintenance either? Our fully managed hosting for WordPress is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
Click through below to explore all of our hosting for WordPress options, or chat with a WordPress expert right now to get answers and advice.
Additional resources
Diagnosing WordPress errors on your site →
Even more common errors, how to troubleshoot them, and how to solve them
Fixed: WordPress failed to write file to disk →
Learn how to fix the “Upload: Failed to Write File to Disk” error in WordPress with easy troubleshooting steps.
What is managed WordPress hosting? →
What it means, what it includes, and how to decide if it’s right for you