WordPress GuideErrors → 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.

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:

If your theme uses a different class name (like .children or .dropdown-menu), replace .sub-menu with that instead.

2. Check your theme’s menu assignment and configuration

Sometimes the menu disappears simply because it hasn’t been assigned to the right location in your theme.

Some themes have unique menu slots or require an additional setting in the Customizer. Check your theme’s documentation to make sure menus are supported in the location you’re using.

3. Clear your browser cache and cookies

Outdated files in your browser cache can cause display issues even after you’ve fixed the CSS.

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:

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:

To rule out a theme conflict:

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.

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.

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.

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