Ahmad Awais

NAVIGATE


SHARE


Should I Create a New Menu or a SubMenu inside WP Admin Panel

Ahmad AwaisAhmad Awais

Yesterday I ranted about Why You Should Never Use Colored Icons Inside the WP Admin Panel which stirred up quite a debate in the WordPress community. About 90% of the folks that I had a conversation with agreed with me, but there were strong arguments against it by some folks. In hindsight, I should have created a poll after the post to attract better & clearer feedback.

New Menu VS a SubMenu inside WP Admin Panel#

This is one other debate which we need to talk about. When building a plugin or a theme, a WordPress developer more often than not needs to provide its users with a way to configure the product at hand. Since this configuration is meant mostly for the administrators, you get to see either a new menu or a sub-menu created for it.

Responsible WP Development#

If you are like me — big fan of consistency and following coding standards is important to you then, chances are you are into what I call responsible WordPress development. As a responsible WP developer, you try and always think about the users first. How will your users interact with your product?

Do you want to be intrusive when it comes to their sites’ admin panels or do you want to weigh more on better user experience? It gets more interesting when you start talking about creating a new menu vs a sub-menu for your product. And that’s where we need to have a discussion today.

The Case for Creating a New Menu#

So, you have built an excellent product. Now you most definitely see it as an important thing for your users, and more so you would want to create a separate menu for it. Believe me, when I created my first few plugins, it made little to no sense to me — at that time — to why not to create a separate menu.

I wanted my plugins to be important; I wanted them to emerge as a brand and what not. But as I grew more fond of development, I realized how important of a responsibility it is for a developer to consider what’s best for the users of his plugin.

Anywho, this is strictly my opinion about this thing. I think a WordPress product should create a new menu only when:

Do NOT create a separate menu just to put a custom icon to help yourself brand the concept. That’s not justifiable enough.

The Case for Settling With Sub-Menus#

This is a hard one. I agree. Most of the times what we build is quite important — it doesn’t hurt to think that way does it? — But at the same time, the utility of your WordPress product has a lot to do with where you put it. By no means, putting your product’s settings page inside the Settings or Tools menu says that it will be ignored or something like it’s less important.

Here’s my take on why and when you should think about creating a sub-menu for your WP product

The Second Pomodoro!#

Clock’s ticking, it’s time to conclude this post. If your product adds a whole new functionality like custom posts types and what not, the average usefulness of its functionality will be greater than 7 (out of 10). Which means you get to create a new menu. On the other hand, if your plugin cleans up the database, or maybe has to do with including social icons to your posts, doesn’t it sound like functionality with secondary importance? It does! That’s why rating it about 5 (out of 10) would not make a lot of sense. In most cases! So, you should think about settling with a submenu there.

Founder & CEO at Langbase.com — The Composable AI Developer platform · Serverless AI Cloud · Ship agentic AI pipes, tools, and memory with BaseAI — The first Web AI Framework (free, open-source, local-first, deploys serverless, agentic pipes, tools, and memory)

Ex VP DevTools & DevRel Eng. Rapid · Google Developers Advisory Board (gDAB) founding member. 🧑‍💻 AI/ML/DevTools Angel InvestorAI/ML Advisory Board San Francisco, DevNetwork

🎩 Award-winning Open Source Engineer & Dev Advocate 🦊 Google Developers Expert Web DevRel 🚀 NASA Mars Ingenuity Helicopter mission code contributor 🏆 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer).

🌳 Node.js foundation Community Committee Outreach Lead, Member Linux Foundation, OpenAPI Business Governing Board, and DigitalOcean Navigator. 📟 Teaching thousands of developers Node.js CLI Automation and VSCode.pro course. Over 142 million views, 24 yrs Blogging, 108K developers learning, 200+ FOSS.

✌️ Author of various open-source dev-tools and software libraries utilized by millions of developers worldwide WordPress Core Developer 📣 TEDx Speaker with 100+ international talks.

As quoted by: Satya Nadella · CEO of Microsoft — Awais is an awesome example for developers.
💜 Loves his wife (Maedah) ❯ Read more about Ahmad Awais.

👋… Awais is mostly active on 𝕏 @MrAhmadAwais

📨

Developers Takeaway

Stay ahead in the web dev community with Ahmad's expert insights on open-source, developer relations, dev-tools, and side-hustles. Insider-email-only-content. Don't miss out - subscirbe for a dose of professional advice and a dash of humor. No spam, pinky-promise!

✨ 172,438 Developers Already Subscribed
Comments 4
  • Ashley
    Posted on

    Ashley Ashley

    Reply Author

    If your product adds a whole new functionality like custom posts types and what not, the average usefulness of its functionality will be greater than 7 (out of 10). Which means you get to create a new menu.”

    Although you could argue that by adding a CPT you’ve probably already added one new menu (for that CPT) and you shouldn’t create another top level menu just for settings. Then you’d have two! In fact, what better place to put your settings than as a submenu for the CPT? An example of this being Easy Digital Downloads.


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      I agree! By adding a CPT, we do NOT by default add it in the menu. There is an option about it being added to the menu or not. That’s why you see I have been working on this listings plugin, which is quite huge, a number of CPTs in it. Here’s one Single menu that it adds. (Which resides at the top because anyone using it will have a listings website which makes the functionality more important than Posts, Media, Pages and everything). It’s a work in progress. Take a look!


  • David
    Posted on

    David David

    Reply Author

    Actually, if it’s a small plugin, if it make sense, it’s probably best to simply create section in wp default settings. Here’s how?


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      Hey, David!
      I’ve been to your blog and I like everything you are writing there. BTW you are actually agreeing with what I said. Thanks for dropping by!