Ahmad Awais



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.

I help businesses understand developers 📟 Currently recording Node.js CLI Automation Course 👨‍🏫 Edutainer at VSCode.pro 🎩 An award-winning open-source engineer and developer advocate 🦊 Google Developers Expert for web 🌳 Node.js foundation Community Committee member ✌️ Author of various open-source dev-tools and software libraries used by millions of developers worldwide ⓦ WordPress Core Developer 📣 TEDx Speaker 🙌 Leading developers and publishing technical content for over a decade 😂 Self-confessed tech comedian cracking silly jokes in the JavaScript web and cloud communities 💜 Loves his wife (Maedah) ❯ Learn more about Awais ↣

Say 👋 on Twitter @MrAhmadAwais | Subscribe to the Developers Takeaway!


Developers Takeaway

Takeaway my professional opinion on open-source, developer relations, growing your business with family, and everything in between! Delivered to your inbox a couple of times every year. I'm even funny at times. I hate spam — pinky-promise!

👨‍💻👩‍💻 115,834 Developers Already Subscribed