{"id":68606,"date":"2022-11-11T15:51:45","date_gmt":"2022-11-11T15:51:45","guid":{"rendered":"\/tutorials\/?p=68606"},"modified":"2026-03-09T19:18:22","modified_gmt":"2026-03-09T19:18:22","slug":"wordpress-hide-admin-bar","status":"publish","type":"post","link":"\/ng\/tutorials\/wordpress-hide-admin-bar\/","title":{"rendered":"How to hide the WordPress admin bar using a plugin, PHP code, and via the user settings"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>When logged-in users access a WordPress website, they can quickly access tools and shortcuts from the admin bar at the top. While useful, some developers might need to hide it for security reasons and visual improvements.<\/p><p>In this article, we will explain how to hide the WordPress admin bar for all users as well as specific roles only. We will also explore three methods with different difficulty levels so you can choose one based on your preferences.<\/p><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-hide-the-wordpress-admin-bar\">How to hide the WordPress admin bar<\/h2><p>Before proceeding, we recommend <a href=\"\/ng\/tutorials\/backup-wordpress\/\">backing up your WordPress website<\/a> so you can easily restore your data in case of errors.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-using-a-plugin\">1. Using a plugin<\/h3><p>If you are unfamiliar with coding, using a WordPress plugin is the easiest way to hide the admin toolbar. This method is also convenient because you can easily revert the changes without altering your website code.<\/p><p>While you can use different WordPress plugins, we recommend <a href=\"https:\/\/wordpress.org\/plugins\/hide-admin-bar-based-on-user-roles\/\">Hide Admin Bar Based on User Roles<\/a>. It offers various options to hide the toolbar and provides frequent updates to ensure security. Here&rsquo;s how to use it:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your <strong>WordPress dashboard<\/strong> and navigate to the <strong>sidebar<\/strong> &rarr; <strong>Plugins<\/strong> &rarr; <strong>Add New Plugin<\/strong>.<\/li>\n\n\n\n<li>Search <strong>Hide Admin Bar Based on User Roles<\/strong> and click <strong>Install Now<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a594c1866dbf\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a594c1866dbf\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1457\" height=\"497\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Hide Admin Bar Based on User Roles plugin in WordPress plugin installation menu\" class=\"wp-image-115108\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=1457,fit=scale-down 1457w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-hide-admin-bar-based-on-user-roles-plugin-in-wordpress-plugin-installation-menu.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1457px) 100vw, 1457px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Once the <a href=\"\/ng\/tutorials\/wordpress\/how-to-install-wordpress-plugins\/\">plugin installation<\/a> process is complete, click <strong>Activate<\/strong>.&nbsp;<\/li>\n\n\n\n<li>Head to the <strong>sidebar<\/strong> &rarr; <strong>Settings <\/strong>&rarr; <strong>Hide Admin Bar Settings<\/strong>.&nbsp;<\/li>\n\n\n\n<li>Choose the user roles you want to hide the top admin bar from by clicking their respective boxes. Once finished, hit<strong> Save Changes<\/strong>.&nbsp;<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a594c1868ae5\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a594c1868ae5\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"855\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=1024,h=1024,fit=scale-down\" alt=\"Hide Admin Bar Based on User Roles Settings page\" class=\"wp-image-115109\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/hide-admin-bar-based-on-user-roles-settings-page.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>That&rsquo;s it! If you want to show the admin bar again, return to the settings menu, untick the box, and save the changes.<\/p><p><div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> Update your plugin periodically to avoid security risks. For <a href=\"\/ng\/wordpress-hosting\">Hostinger managed WordPress hosting<\/a> users, we recommend enabling the auto-update feature to simplify the task.\n            <\/p><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/ng\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-2-using-php-code\">2. Using PHP code<\/h3><p>Installing too many plugins might cause performance issues and security risks if you don&rsquo;t audit them properly. In this case, you might want to hide the WordPress admin bar manually by <a href=\"\/ng\/tutorials\/wordpress\/how-to-add-php-code-to-wordpress-post-or-page\/\">adding custom PHP code to your WordPress<\/a> theme file.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> If you are unfamiliar with PHP, we recommend testing the code snippets in a <a href=\"\/ng\/tutorials\/wordpress-staging-environment\/\">WordPress staging area<\/a> to avoid breaking the live website.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><p>Before doing so, <a href=\"\/ng\/tutorials\/how-to-create-wordpress-child-theme\/\">create and activate a child theme<\/a> to ensure your custom PHP remains after an update. Now, let&rsquo;s proceed with the steps for hiding the admin bar:<\/p><ol class=\"wp-block-list\">\n<li>Open your<strong> WordPress admin are<\/strong>a &rarr; <strong>sidebar<\/strong> &rarr; <strong>Tools<\/strong> &rarr; <strong>Theme File Editor<\/strong>.<\/li>\n\n\n\n<li>Head to the <strong>Theme Files <\/strong>side menu on the right. Select the <a href=\"\/ng\/tutorials\/functions-php-wordpress\/\"><strong>functions.php<\/strong><\/a><strong> <\/strong>file.&nbsp;<\/li>\n\n\n\n<li>From the code editor screen, add the following snippet at the bottom of the file before the <strong>?&gt;<\/strong> closing tag:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">add_filter('show_admin_bar', '__return_false');<\/pre><ol class=\"wp-block-list\" start=\"4\">\n<li>Click <strong>Update File<\/strong>.&nbsp;<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a594c186b266\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a594c186b266\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"755\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=1024,h=1024,fit=scale-down\" alt=\"PHP code for hiding the admin bar in the Theme File Editor screen\" class=\"wp-image-115111\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/php-code-for-hiding-the-admin-bar-in-the-theme-file-editor-screen.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Note that the snippet above will hide the WordPress admin bar for all users, regardless of their roles.<\/p><p>If you want to hide the admin bar for a specific account role, use the following code instead. For example, we will disable the toolbar for those with the subscriber role:<\/p><pre class=\"wp-block-preformatted\">if (current_user_can('subscriber')) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;add_filter('show_admin_bar', '__return_false');<br><br>}<\/pre><p>With this code, you can also hide the admin bar for all users except for a specific role. For instance, we will show the toolbar only for those with administrative privileges:<\/p><pre class=\"wp-block-preformatted\">add_action('after_setup_theme', 'remove_admin_bar');<br><br>function remove_admin_bar() {<br><br>if (!current_user_can('administrator') &amp;&amp; !is_admin()) {<br><br>show_admin_bar(false); }<br><br>}<\/pre><p>To revert the changes, simply delete the code from the <strong>PHP<\/strong> file and save the changes.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-via-user-settings\">3. Via user settings<\/h3><p>As an administrator, you can easily disable the WordPress admin bar for specific users via the account settings menu. Here&rsquo;s how to do so:<\/p><ol class=\"wp-block-list\">\n<li>Log in to the <strong>WordPress admin dashboard<\/strong> &rarr; <strong>sidebar<\/strong> &rarr; <strong>Users<\/strong> &rarr; <strong>All Users<\/strong>.<\/li>\n\n\n\n<li>Hover over the account you want to hide the admin bar from and click <strong>Edit <\/strong>profile.<\/li>\n\n\n\n<li>Go to the <strong>Toolbar<\/strong> setting and untick the box.&nbsp;<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a594c186ccb6\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a594c186ccb6\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1460\" height=\"192\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Toolbar toggle in WordPress user setting menu\" class=\"wp-image-115112\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=1460,fit=scale-down 1460w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/09\/the-toolbar-toggle-in-wordpress-user-setting-menu.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1460px) 100vw, 1460px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"4\">\n<li>Scroll down to the bottom and click <strong>Update User<\/strong> to save the changes.<\/li>\n<\/ol><p>Now, when the user logs in, they won&rsquo;t see the admin bar. Remember that this method only hides the toolbar for a specific user, meaning you must repeat the steps to apply the changes to multiple accounts within the same role.<\/p><p>Also, you can only manage other users&rsquo; settings if you are logged in as an administrator. Otherwise, you must manually log in to that account and change its configuration.<\/p><h2 class=\"wp-block-heading\" id=\"h-why-should-you-hide-the-wordpress-admin-bar\">Why should you hide the WordPress admin bar?<\/h2><p>Developers opt to hide the WordPress admin bar for various reasons. Here are some common considerations why you might want to do so:<\/p><ul class=\"wp-block-list\">\n<li><strong>Security concerns<\/strong>. The WordPress admin bar provides shortcuts to various functions that can alter your website, including editing posts and accessing the dashboard. Hiding the toolbar limits potential entry points that unauthorized users might exploit.&nbsp;<\/li>\n\n\n\n<li><strong>Visual enhancement<\/strong>. Users might find the WordPress admin bar ruining the web page&rsquo;s appearance. Hiding it helps improve the website&rsquo;s visuals and maintain consistency across all users.&nbsp;<\/li>\n\n\n\n<li><strong>Functionality<\/strong>. For logged-in users, the top admin bar at the top of the web page might obstruct important parts of the website. For example, it might prevent them from accessing the search bar or navigation menu.<\/li>\n\n\n\n<li><strong>User control<\/strong>. Administrators might hide the WordPress admin bar to <a href=\"\/ng\/tutorials\/create-manage-wordpress-user-roles-permissions\/\">manage user roles<\/a> and access permissions over the website.&nbsp;<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>WordPress admin bar offers quick-access tools and shortcuts for various functions. However, developers might want to hide it due to potential security risks and visual obstructions.<\/p><p>In this article, we have explained multiple ways to temporarily remove the admin bar. Here&rsquo;s the recap:<\/p><ul class=\"wp-block-list\">\n<li><strong>Using plugin<\/strong>. This method is ideal for beginners with minimal coding experience. Install plugins like Hide Admin Bar Based on Roles on WordPress and disable the toolbar via Settings.<\/li>\n\n\n\n<li><strong>Adding PHP code<\/strong>. Developers can hide the admin bar by adding PHP functions and filters to the <strong>functions.php<\/strong> file. You can apply the setting for specific user roles using the <strong>if<\/strong> statement.&nbsp;<\/li>\n\n\n\n<li><strong>Via user settings<\/strong>. Admin users can hide the admin bar for a specific account by unchecking the <strong>Toolbar<\/strong> option in the settings menu. If you don&rsquo;t have the privilege, you must log in to that particular account first.<\/li>\n<\/ul><p>We hope this article helped you choose a suitable method for hiding the WordPress admin bar on your website. If you have any questions, leave us a comment below!<\/p><h2 class=\"wp-block-heading\" id=\"h-hide-wordpress-admin-bar-faq\">Hide WordPress admin bar FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1725374609024\"><h3 class=\"schema-faq-question\">What is the WordPress admin bar?<\/h3> <p class=\"schema-faq-answer\">WordPress admin bar is a top menu that logged-in users see when accessing a website. It provides quick access to various tools and shortcuts, including redirecting you to the post editor or the WordPress admin dashboard.&nbsp;<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1725374615182\"><h3 class=\"schema-faq-question\">Do I need the WordPress admin bar?<\/h3> <p class=\"schema-faq-answer\">It depends on your needs. If you want to quickly edit a post or access tools without opening the WordPress dashboard, then you need the toolbar. However, if you are concerned about security and visibility issues, we recommend hiding it.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1725374620399\"><h3 class=\"schema-faq-question\">Will hiding the admin bar affect my WordPress site?<\/h3> <p class=\"schema-faq-answer\">Hiding the admin bar won&rsquo;t affect other aspects of your WordPress site. You can also easily revert the changes by uninstalling the plugin or deleting the PHP code. However, we always recommend backing up your WordPress before making any changes.<\/p> <\/div> <\/div><p><\/p><p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When logged-in users access a WordPress website, they can quickly access tools and shortcuts from the admin bar at the top. While useful, some developers might need to hide it for security reasons and visual improvements. In this article, we will explain how to hide the WordPress admin bar for all users as well as [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/wordpress-hide-admin-bar\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to hide WordPress admin bar: 3 effective methods","rank_math_description":"Learn the three methods to hide the WordPress admin bar \u2013 using the Hide Admin Bar plugin, using a custom code, and via the user settings.","rank_math_focus_keyword":"wordpress hide admin bar","footnotes":""},"categories":[22637],"tags":[],"class_list":["post-68606","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-hide-admin-bar\/","default":1},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-hide-admin-bar\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-hide-admin-bar\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/68606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=68606"}],"version-history":[{"count":14,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/68606\/revisions"}],"predecessor-version":[{"id":144297,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/68606\/revisions\/144297"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=68606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=68606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=68606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}