WordPress GuideAdmin → Menu

WordPress admin menu: how to add a separator to a submenu

Image

The WordPress admin menu can get cluttered fast, especially if you’re building a plugin or a site with lots of custom post types. Sometimes, you need to group related submenu items—or break things up for clarity. But there’s just one problem: WordPress doesn’t give you a built-in way to add separators inside a submenu.

With a bit of custom code, though, you can make this work.

Let’s walk through three ways to add a submenu separator … and one way to make it even better using simple CSS.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

What to know before adding submenu separators

WordPress has a built-in feature to add separators to the main admin menu, using the class wp-menu-separator. But it doesn’t offer the same for submenu items.

Submenu separators have to be “faked” by creating non-functional links or styling dummy submenu items. These tricks are safe to use, but they’re not officially documented, so you’ll need to be careful about how you name and structure them.

Method 2: Make your separator item look different with CSS

If you want more control over how the separator looks—like gray text, italic font, or no hover effect—you can target the submenu item with CSS.

1. Give your submenu item a unique slug

You already did this in Method 1 with ‘submenu-separator’. This gives us something to target.

2. Add CSS in the admin area

Use the admin_head hook to inject a <style> block into the admin area.

3. What this CSS does

You can customize this even further with icons, background colors, or padding.

Method 3: Use a heading-style label instead of a line

Sometimes a separator isn’t the best option. Instead, you might want a section label—like a non-clickable heading inside the submenu.

Here’s how to do that:

This won’t act like a separator line, but it helps organize items by category. Combine this with CSS to make it bold, uppercase, or colored for better effect.

Optional: Only show separators to certain users

If your site has multiple roles (like Editors, Authors, Admins), you may want separators to appear only for admins—especially if they’re the only ones who need to see advanced tools.

Here’s how to conditionally register the separator:

This helps keep the interface simpler for non-admin users.

Bonus: Use Dashicons or Unicode symbols for more visual separators

You can get creative with submenu separators by using icons or Unicode characters. This makes them more noticeable—and often easier to scan quickly.

Ideas to try:

To use Dashicons with CSS:

This adds a “divider” icon in front of your submenu label. Make sure to enqueue Dashicons if you’re not already using them.

Additional resources

How to use your WordPress admin login page →

How to find, use, and troubleshoot your admin page

WordPress privacy policy: how to write one and how to add it to your site →

Create a comprehensive privacy policy for your WordPress site to ensure compliance and build user trust.





Easy WordPress website maintenance tips →

7 simple steps to keep on regular rotation