{"id":233,"date":"2020-06-09T07:19:11","date_gmt":"2020-06-09T07:19:11","guid":{"rendered":"https:\/\/codexjunction.com\/?p=233"},"modified":"2023-10-29T16:43:58","modified_gmt":"2023-10-29T16:43:58","slug":"hide-admin-bar-in-wordpress","status":"publish","type":"post","link":"https:\/\/codexjunction.com\/hide-admin-bar-in-wordpress\/","title":{"rendered":"Hide Admin Bar in WordPress to Users Except Admin"},"content":{"rendered":"<p data-sourcepos=\"1:1-1:56\">There are three ways to hide the admin bar in WordPress:<\/p>\n<p data-sourcepos=\"3:1-3:36\"><strong>1. Using the WordPress dashboard<\/strong><\/p>\n<ol data-sourcepos=\"5:1-9:0\">\n<li data-sourcepos=\"5:1-5:35\">Go to\u00a0<strong>Users<\/strong>\u00a0&gt;\u00a0<strong>All Users<\/strong>.<\/li>\n<li data-sourcepos=\"6:1-6:61\">Click on the user&#8217;s name whose admin bar you want to hide.<\/li>\n<li data-sourcepos=\"7:1-7:85\">Under the\u00a0<strong>Toolbar<\/strong>\u00a0section, uncheck the\u00a0<strong>Show Toolbar when viewing site<\/strong>\u00a0box.<\/li>\n<li data-sourcepos=\"8:1-9:0\">Click\u00a0<strong>Update Profile<\/strong>.<\/li>\n<\/ol>\n<p data-sourcepos=\"10:1-10:52\">This will hide the admin bar for the specified user.<\/p>\n<p data-sourcepos=\"12:1-12:31\"><strong>2. Using a WordPress plugin<\/strong><\/p>\n<p data-sourcepos=\"14:1-14:121\">There are many <a href=\"https:\/\/wordpress.org\/plugins\/\" rel=\"nofollow\">WordPress plugins<\/a> that can be used to hide the admin bar. One popular plugin is called <strong>Hide Admin Bar<\/strong>.<\/p>\n<p data-sourcepos=\"16:1-16:19\">To use this plugin:<\/p>\n<ol data-sourcepos=\"18:1-22:0\">\n<li data-sourcepos=\"18:1-18:35\">Install and activate the plugin.<\/li>\n<li data-sourcepos=\"19:1-19:43\">Go to\u00a0<strong>Settings<\/strong>\u00a0&gt;\u00a0<strong>Hide Admin Bar<\/strong>.<\/li>\n<li data-sourcepos=\"20:1-20:66\">Select the user roles for which you want to hide the admin bar.<\/li>\n<li data-sourcepos=\"21:1-22:0\">Click\u00a0<strong>Save Changes<\/strong>.<\/li>\n<\/ol>\n<p data-sourcepos=\"23:1-23:57\">This will hide the admin bar for the selected user roles.<\/p>\n<p data-sourcepos=\"25:1-25:23\"><strong>3. Using custom CSS<\/strong><\/p>\n<p data-sourcepos=\"27:1-27:117\">You can also use custom CSS to hide the admin bar. To do this, add the following code to your theme&#8217;s style.css file:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<div class=\"code-block-decoration header gmat-subhead-2 ng-star-inserted\">CSS<\/div>\n<pre><code class=\"code-container\" role=\"text\"><span class=\"hljs-selector-tag\">body<\/span><span class=\"hljs-selector-class\">.admin-bar<\/span> {\r\n  <span class=\"hljs-attribute\">display<\/span>: none;\r\n}\r\n<\/code><\/pre>\n<div class=\"code-block-decoration footer gmat-overline hide-from-message-actions ng-star-inserted\">\n<div>Use code with caution.\u00a0<a class=\"disclaimer-suffix\" href=\"https:\/\/bard.google.com\/faq#coding\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Learn more (opens in a new window)\">Learn more<\/a><\/div>\n<p><button class=\"mat-mdc-tooltip-trigger copy-button mdc-icon-button mat-mdc-icon-button gmat-mdc-button-with-prefix mat-unthemed mat-mdc-button-base gmat-mdc-button\" aria-label=\"Copy code\">content_copy<\/button><\/p>\n<\/div>\n<\/div>\n<p data-sourcepos=\"35:1-35:43\">This will hide the admin bar for all users.<\/p>\n<p data-sourcepos=\"37:1-37:32\"><strong>Which method should you use?<\/strong><\/p>\n<p data-sourcepos=\"39:1-39:368\">The best method to use depends on your needs. If you only need to hide the admin bar for a specific user, then you can use the WordPress dashboard method. If you need to hide the admin bar for multiple users, then you can use a WordPress plugin. If you need to hide the admin bar for all users, and you are comfortable with CSS, then you can use the <a href=\"https:\/\/codexjunction.com\/12-best-wordpress-lazy-load-plugins-to-make-your-website-faster\/\">custom CSS method<\/a>.<\/p>\n<p data-sourcepos=\"41:1-41:18\">I hope this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are three ways to hide the admin bar in WordPress: 1. Using the WordPress dashboard Go to\u00a0Users\u00a0&gt;\u00a0All Users. Click on the user&#8217;s name whose admin bar you want to hide. Under the\u00a0Toolbar\u00a0section, uncheck the\u00a0Show Toolbar when viewing site\u00a0box. Click\u00a0Update Profile. This will hide the admin bar for the specified user. 2. Using a WordPress plugin There are many WordPress plugins that can be used to hide the admin bar. One popular plugin is called Hide Admin Bar. To use this plugin: Install and activate the plugin. Go to\u00a0Settings\u00a0&gt;\u00a0Hide Admin Bar. Select the user roles for which you want to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":291,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[512,255,508,510,511,509],"class_list":["post-233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-a-online-course-web-tutorial","tag-hide-admin-bar","tag-learn-java-online","tag-learn-laravel-online","tag-learn-php-online","tag-learn-python-online"],"_links":{"self":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":8,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"predecessor-version":[{"id":2658,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/233\/revisions\/2658"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/media\/291"}],"wp:attachment":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}