Disable certain Luci menu items

Is it possible to disable/remove certain menu items from Luci?
(The information I found on this seems to be outdated)

If so, is it possible to do this by configuring and existing implementation, ot do you need to build a new version?


I'd start with playing with js-files in /www/luci-static/resources/.

Thanks, Stan.
I tried this. As all the .js files have been obfuscated and/or processed otherwise, I got the files from github. That did work, to some extent.
However, I stumbled on a number of files describing the user interface in /usr/share/luci/menu.d
I removed a number of sections from these files, rebooted , and the unwanted menu items were no longer visible. Not sure if this is the way to go, but it does the job and so far I have not noticed any side-effects.
If someone knows of a reason why I should not do this, I'd be glad to know.

Modifying the menu JSON files is the proper way to do it.

1 Like

Thanks for the feedback, jow
That's reassuring to know!

I am looking to do the same thing. I found the JSON Files in the /usr/share/luci/menu.d. The problem is I cant alter any of the tab items for Modem or Network. How do I remove options from the drop down tab selection?

1 Like

Not all packages add menu item using a json file. Some packages add menu item using the entry function inside the lua code.

Therefore, the most correct solution would be to patch the dispatcher.lua file. An example can be seen here: https://github.com/openwrt-xiaomi/openwrt/commit/187575c3606f2789a80b908b23edc0be27af0dfc
This patch is very easy to modify for the functionality of removing unnecessary menu items.

1 Like