Remove Admin Bar for all Users except for Administrators

jdunhin

Active member
Registered
Joined
Feb 27, 2013
Messages
72
Points
0
Paste the code in your themes function.php
PHP:
add_action('init', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}
Or remove it completely for all users
PHP:
show_admin_bar(false);
 

Marc0

Well-known member
Registered
Joined
Jun 6, 2012
Messages
890
Points
28
Thanks for good code!
It's great if you can show a screenshot in your tips to explain for everyone easy to understand.
 
Older Threads
Replies
2
Views
3,470
S
Replies
1
Views
3,342
Newer Threads
Replies
4
Views
3,952
Replies
3
Views
3,780
Replies
3
Views
3,290
Replies
0
Views
3,211
Replies
0
Views
2,090
Recommended Threads
Replies
1
Views
1,236
Replies
10
Views
9,903
Replies
8
Views
5,573
Replies
8
Views
3,713
Replies
11
Views
3,230

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top