Har du någonsin undrat om det är möjligt att städa upp i WordPress admin area för dig själv och dina användare?
Det finns många saker i WordPress admin area (wp-admin) som dina användare, auktoriseringar eller kunder inte behöver se eller använda. Att städa upp i admin area hjälper till att hålla dem fokuserade på endast de alternativ de behöver utan distraherande röran.
I den här artikeln kommer vi att visa dig hur du döljer onödiga objekt från WordPress admin.
Varför dölja admin menu items i WordPress?
I WordPress admin area finns det många menyer, undermenyer, alternativ och inställningar för teman och plugins som du kan ändra när som helst. Några av dessa WordPress admin menu items inkluderar dashboard widgets, post edit area, plugins, appearance, tools, och mer.
De flesta av dessa alternativ i menyn används dock inte dagligen, och det slutar med att de skräpar ner på admin-skärmen. Om du runar en WordPress-webbplats med flera auktoriseringar eller har kunder som besöker admin area, är det en god praxis att städa upp WordPress adminpanel.
Du bör bara behålla menyer och alternativ som är användbara för dina författare och kunder och dölja resten av undermenyerna.
Du kanske också vill deactivate objekt baserat på användarnas roller genom att skapa olika admin-gränssnitt för användare med olika roller och capability på din WordPress-webbplats.
Med det sagt, låt oss titta på hur du kan ta bort onödiga menu items från WordPress admin.
Note: Den här guiden handlar om admin-menyn back-end som en registrerad användare på din site ser när de loggar in.
Om du vill customize de navigationsmenyer som alla besökare på din website ser, bör du läsa vår Step-by-Step guide om hur du lägger till en navigation menu i WordPress.
Video Tutorial
Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.
Hur man döljer specifika WordPress Admin Menu Items
Det mest nybörjarvänliga sättet att dölja menyer och objekt från WordPress adminpanel är genom att använda tillägget Admin Menu Editor. Det är ett gratis WordPress plugin som låter dig ändra menyns titlar, URL:er, icons, och mer.
Du kan också dölja menyobjekt från admin sidebar, ställa in behörigheter för användarroller och dra and drop menyobjekt för att organisera din WordPress admin bar.
Först måste du installera och aktivera pluginet Admin Menu Editor. För mer detaljer, vänligen se vår guide om hur du installerar ett plugin för WordPress.
När du har aktiverat kan du heada till Settings ” Menu Editor från din WordPress dashboard. På den här sidan med inställningar ser du alla dina meny- och undermeny-objekt under tabben ”Admin Menu”.
You can simply drag and drop your menu items to rearrange their order. Det finns också alternativ för att ta bort eller lägga till nya menu items.
Gå sedan vidare och klicka på nedåtpilen för valfritt menu-item för att se fler alternativ. You can rename the menu title, change the target page, and more.
För att dölja ett admin menu item för en specifik användare, clickar du bara på dropdown-menyn ”Extra capability”. Därefter kan du välja vilken roll användaren har som kan viewa menu-item från de givna alternativen.
Låt oss till exempel säga att du vill dölja menyn Media och dess undermenyer för alla användare utom administratören. För att göra det klickar du bara på dropdown-menyn ”Extra capability” och väljer ”Administratör” under Roller.
När you är klar kan du gå vidare och save your changes.
Nu kommer mediaobjektet endast att vara synligt för rollen Administratör och kommer att vara dolt för andra användare.
Om någon fortfarande försöker komma åt det dolda menu itemet genom att skriva in URL:en kommer de att se error-meddelandet”You do not have sufficient permissions to access this admin page”.
Du kan nu upprepa dessa steg för att dölja andra admin menu items och plugins för olika användare.
För fler sätt att customize din WordPress-admin kan du kontrollera dessa guider:
- Viktiga tips för att skydda ditt admin area i WordPress (Updated)
- Hur man white labelar din WordPress dashboard
- Så här addar du Customize Admin Notices i WordPress
- Så här skyddar du din WordPress Admin (wp-admin) Directory med password
- Så här ändrar du färgschemat för Admin i WordPress (snabbt och enkelt)
Vi hoppas att den här artikeln hjälpte dig att dölja onödiga objekt från WordPress admin area. Du kanske också vill kontrollera vår kompletta WordPress tutorial om sökmotorsoptimering (SEO) och de bästa WooCommerce-tilläggen.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Austin says
Hello:
I am trying to remove the widget tab from the dropdown menu under the page url for editors.
When you are logged in and have hit the ”visit site” option under the site url in the upper left hand corner, then you hover back over the site url, it now shows options in the drop down, i.e dashboard, widgets, menu. I would like to remove widgets from this menu for editors.
Thanks
WPBeginner Comments says
Something like Widgets would be under the Appearance dropdown.
In the Admin Menu Editor plugin settings, you would select the Appearance dropdown, and then the Widget dropdown on the right menu.
You can then assign the ’Extra capability’ needed for that feature.
Jiří Vaněk says
I have been using the website every day for about a year and a half. During that time, I have already installed almost everything I need for my work, but the truth is that it now has twice as many items and practically I need maybe half of it. Is it necessary to install a plugin, or can some parts of the menu be hidden with a snippet? He would like to avoid another plugin.
WPBeginner Support says
The code required in a snippet would be a bit beyond what we would recommend for beginners which is why we recommend the plugin. For concerns about using a plugin we would recommend taking a look at our article below:
https://www.wpbeginner.com/opinion/how-many-wordpress-plugins-should-you-install-on-your-site/
Administratör
JAVED AKHATR NAYYER says
this is good method but how can i again showed all menues please discribe
WPBeginner Support says
You would want to use the load default menu button on the side to return to the default menu.
Administratör
Howard Hue says
Hey. Don’t use a plugin just use a conditional IF statement. There are a bunch you can use but here are a couple good ones to add to your functions or custom functions file.
If you’re savvy with WP and some light coding this is the best alternative to a plugin by far, in my opinion.
// Remove a main menu page link on admin/dash
remove_menu_page( ’$mainmenu-sluge’ );
// Remove a main menu’s submenu link on admin/dash
remove_submenu_page( ”$mainmenu-slug”, ”$submenu-slug”);
Hope this helps.
WPBeginner Support says
Thank you for sharing this, our guides are designed for beginners that don’t have coding knowledge first but for those looking for an alternative, this could be a helpful option.
Administratör
Kumar says
we have wordpress site, in our admin panel settings and Appearance not available, don”t why…whats the problem…
WPBeginner Support says
Your user may not be an admin user for your site if you had someone else set it up for you.
Administratör
Kenneth Bryan Domingo says
Hi! I want to hide the tutorial tab on my menu but I can’t find it can anyone help me? I can send you pictures of it. Thanks!
WPBeginner Support says
If the menu is added via a plugin then you would want to reach out to your plugin’s support and they should be able to help you with hiding it.
Administratör
vincent says
Is the tick displayed or hidden? Is there a suggested role setting? Specific teaching
WPBeginner Support says
If it is checked/ticked then that item would be removed from that level’s view
Administratör
Hurab says
please guide how to disable the notification for editor. i have tried already but still can see.
Pleaseguide
WPBeginner Support says
There should be the option to disable admin notices depending on the notices you no longer want to appear.
Administratör
KITHO says
How can I hide some menu items for only certain Administrators not all of them? Because there are admins that I don’t want to touch on any design/customizations.
Leon Lalaev says
Use this function in theme function p h p file
Ron says
Hi,
Any news/info/solution/… about those flags! I have just installed plugin (super cool I must say), add demo user, playing with restrictions, logged in on another machine as demo user… ok. Done this ”To view your changes to the menu you need to navigate away from the Adminimize settings page.” several times…
But on the end of a day if this demo user would call me and said ”I don’t see Woocommerce”… Well demo user! I see no flags on your Woo…
Good for me to add demo user. I think I said enough.
Br,
Naomi says
Thank you, I have just installed and worked fine!
Sreeny says
Wow !
Very useful article.
Superb !
Julie says
I didn’t know this plugin, it’s amazing! Thank you so much for making me discover it, you saved my life haha
Giovanni says
Hello.
After the last update 1.10.1 no longer see the flags of the things that I selected.
How can I do?
Thanks in advance.
Cliff says
Thank you.
This was very helpful.
Sherry says
If I have role1 and role2 and each role has their own sidebar widget. Is there a way to add a hook so that when role1 is logged in they will only see sidebar widget1 and when role2 is logged in they will only see sidebar widget2. (see and be able to edit their own widget)
Currently adminimize allows me to show or hide sidebar so there is no way to specify which sidebar widget.
Thanks
Patrick says
This saved me alot! I have this annoying client that keeps on destroying a customized (hard-coded) theme by resetting the appearance theme option on purpose to keep on demanding for unnecessary revisions. Now they can only edit posts which is suppose to be what the client should only be doing.
Thanks alot for this!
robert says
i think is better to use of hack rather than using too many plugins and most of them has bug also, which allow hackers kill your website! for example here i share you some of those codes to hide admin items:
function remove_dashboard_widgets() {
global $menu,$submenu;
global $current_user;
get_currentuserinfo();
if ($current_user->ID != 1) { // only admin sees the whole thing
// $menu and $submenu will return fo all menu and submenu list in admin panel .
$menu[2] = ””; //Dashboard
$menu[5] = ””; // Posts
$menu[15] = ””; //Links
$menu[25] = ””; //Comments
$menu[65] = ””; //Plugins
unset($submenu[’themes.php’][5]); //themes
unset($submenu[’themes.php’][12]); //editor
}
}
add_action(’admin_head’, ’remove_dashboard_widgets’);
Linda says
Robert, your information is interesting. But as a non-coder, I wouldn’t know where to put this little nugget. Any more info on that?
Gozie says
you’re right, and I used your code, it worked well. but how did you come up with this and how can I use it for more security like disabling access to some other sections of my website. thanks.
gina says
I have comments deactivated in adminimize in the menu options but it stil shows up on the admin screen for all users. I would like only admins and editors to see the comments.
Matt Rock says
While the article is promising, as of this writing the plugin is compatible up to version 3.6 and hasn’t been updated in almost a year.
I currently update the functions file using a great tutorial by Justin Tadlock (http://tinyurl.com/qda95ap) but this plugin looks like it would really streamline the process.
Does anyone know of a similar plugin which is actively maintained and
compatible with the latest version of wordpress (currently 3.9)?
e-rik says
While the possibilities of this plugin are very nice and extensive, It misses one giant thing: the possibility to minimize the dashboard for certain administrators. On my client’s sites I want to maintain full access on my own admin account and limit the client’s admin acount(s). Or did I miss something and is this possible?
Itay says
You will need to use it in cojunction with
User Role Editor plugin.
WPBeginner Staff says
No, it does not.
WPBeginner Staff says
Yes it is multisite compatible. We will try to cover the scaling of multisite WordPress in some future article. Thanks for the suggestion. However, for the time being try using plugins that are well coded, come highly recommended, and are well documented.
lucky says
I installed it on multisite but wanted to control these things network wide not site by site. I could see no way to do that.
ThatK1dB says
This is great. i just had a client with no knowledge of WP and had to disable certain features so he didn’t blow this thing up. This plugin has helped. Also, very easy to use.
Thanks!
Jeff says
I agree. Same problem. Easy to deactivate permissions, but an editor in itself does not have access to certain features which mean I need to give admin role to managers of the site. Then I ”deactivate” features and me too as an admin lose the same permissions! Weird.
This plugin is undiectional – yuo can deactivate but not asctivate permissions.
Itay says
You will need to use it in cojunction with
User Role Editor plugin.
aathi says
is it multisite compatible ? And also can you do a post on scaling a multisite along with plugins ?it will be useful for us.We are finding it difficult to find info about wordpress multisite. Your help will be appreciated.
RW says
This looks like an amazing plugin! Wow, I wonder if something this powerful adds a lot of weight and queries to the database. Does this plugin slow down editing the site?