{"id":54689,"date":"2018-05-25T14:33:51","date_gmt":"2018-05-25T17:33:51","guid":{"rendered":"https:\/\/samuelchopard.ch\/wiki\/?p=54689"},"modified":"2019-03-18T14:29:18","modified_gmt":"2019-03-18T13:29:18","slug":"disable-wordpress-admin-bar-for-all-users-except-administrators","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/disable-wordpress-admin-bar-for-all-users-except-administrators\/","title":{"rendered":"Disable WordPress admin bar for all users except administrators"},"content":{"rendered":"<p><!--more--><\/p>\n<p>Paste the following in <strong><em>functions.php<\/em><\/strong>:<\/p>\n<pre class=\"EnlighterJSRAW\">add_action('after_setup_theme', 'remove_admin_bar');\n \nfunction remove_admin_bar() {\nif (!current_user_can('administrator') &amp;&amp; !is_admin()) {\n  show_admin_bar(false);\n}\n}\n<\/pre>\n<p>Source:\u00a0<a target=\"_blank\" href=\"http:\/\/www.wpbeginner.com\/wp-tutorials\/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators\/\">http:\/\/www.wpbeginner.com\/wp-tutorials\/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Paste the following in functions.php: add_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') &amp;&amp; !is_admin()) { show_admin_bar(false); } } Source:\u00a0http:\/\/www.wpbeginner.com\/wp-tutorials\/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators\/","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[25,85],"class_list":["post-54689","post","type-post","status-publish","format-standard","hentry","category-woocommerce","tag-admin-bar","tag-disable"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=54689"}],"version-history":[{"count":1,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54689\/revisions"}],"predecessor-version":[{"id":54847,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54689\/revisions\/54847"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=54689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=54689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=54689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}