How to remove the WordPress administration menus

Even though you have not stopped to think about it, there are many WordPress administration menus that are probably over, that you or your users do not use and, surely, it would be better if they were not visible .

So let's take a couple of WordPress functions to get rid of them menus and submenus , but all at least those that we do not need or do not want to be in view.

Top secret

Removing WordPress menus

So, if we take a look at the default menus of WordPress, to remove them all we would have to, using the function remove_menu_page add this code to your function plugin :

If you leave it such what will happen to this …

To this other …

You will have hidden all the menus which does not mean you can not access the pages administration, which still exist.

So if you type, for example, the address of your domain plus /wp-admin/users.php you can still access the user management. But eyes that do not see, adjust that they do not touch you, more, if the rest of users do not know the URLs.

Of course, use the lines you want, there is no reason to hide them all.

To the chains previous you can add, or replace, for those you want to, for example, not display the JetPack menu, the Yoast menu or the one you want.

An example would be this:

And how do you know what to put on the line for the menus of your plugin? Well it's a simple that scares, you just have to look, accessing your page of administration, in which is its URL.

In this way, if when accessing the Yoast SEO settings page, the URL is this …

Then what you have to include after the function remove_menu_page en wpseo_dashboard without modifiers if any. Easy, right?

And if, for some reason, there are rebel menus, which refuse to remove them you can use the action with another priority, substituting the last line of the code above for this other:

Removing WordPress submenus

Thinner is not removing menus, but only those submenus you want to remove from prying eyes . For this we will use the function remove_submenu_page .

And an example would be this:

E, as in the previous case, you can include any sub-menu of plugins or the subject just by looking at its URL.


I told you above this trick is not useful for advanced users who know the administration URLs by heart, but it's great to remove dangerous menus for your clients from their view without having to deactivate anything and without having what use plugins, because you do everything with standard WordPress functions.

Loading …

That may also help you:

How to remove the limit to WordPress menus • WordPress Help

As we saw some time ago there is a limit on the amount of items you can add to a custom WordPress menu something that is not determined by the WordPress itself but by the server where it is hosted.

This amount, in some cases can be around 50 items and in others 100 but it can vary depending of the configuration of your server, and in particular of Suhosin an advanced PHP protection system that is used in many servers.

Specifically, there is a variable determined by Suhosin that limits the maximum amount of elements that can be saved using PHP scripts, causing this limit on the number of items you can add to a menu in WordPress .

Okay you should not go crazy with the menus and add dec elements but on some websites is essential to offer visitors access to multiple sections such as on news websites, with sub-menus by provinces, categories and subcategories, so it's not that weird

As we saw some time ago, you can modify the parameter that causes this limitation by modifying the PHP.INI file but we will not always have access to this parameter, so let's see some other more accessible solution for the common mortals, especially if we are hosted on shared servers, where there is normally no access to the PHP configuration .

As usual, there is a code that we can add to the file ] .htaccess for skip the limit of WordPress menu items that the server puts us through Suhosin.

Just add this line to your file .htaccess located in the root folder of your WordPress installation:

If that was not enough you could upload it ( reasonably) up to 10,000 normally.

Now, this modification will not always work. In that case you should refer to try remove the limitation from PHP.INI or go to the next method if you have it available.

You rarely find hosting providers that offer a utility to configure the parameters of PHP If this were your case, simply access this utility and modify the values ​​of the parameter max_input_vars to a value where you will not have problems adding as many menu items as "you need".

In the case of ] CDmon you can do it from the section Configure Server of the user panel, specifically in the icon called Configure PHP . There you will find the site where to upload the parameter max_input_vars from the initial values ​​of 1,000 up to the usual limit for shared servers of 10,000, normally more than enough.

You must bear in mind that it is never good to take the limit the configurations of the server, and that increasing the benefits on the one hand can result in an unexpected loss of resources in another aspect, so use this type of tricks only if absolutely necessary, and always aware of possible side effects.

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: