{"id":1558,"date":"2010-10-04T22:36:06","date_gmt":"2010-10-04T20:36:06","guid":{"rendered":"http:\/\/planetozh.com\/blog\/?p=1558"},"modified":"2011-02-23T23:17:44","modified_gmt":"2011-02-23T21:17:44","slug":"how-to-remove-wordpress-admin-bar","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2010\/10\/how-to-remove-wordpress-admin-bar\/","title":{"rendered":"How To Remove WordPress&#8217; Admin Bar"},"content":{"rendered":"<p>It will be a matter of personal preference or a matter of clients asking for it, but I bet this one is going to be a frequent question in the next months: &quot;How do I remove the Admin Bar?&quot;.<\/p>\n<div id=\"attachment_1559\" style=\"width: 507px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1559\" src=\"http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/10\/no-admin-bar.jpg\" alt=\"\" title=\"no-admin-bar\" width=\"497\" height=\"331\" class=\"size-full wp-image-1559\" srcset=\"https:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/10\/no-admin-bar.jpg 497w, https:\/\/planetozh.com\/blog\/wp-content\/uploads\/2010\/10\/no-admin-bar-300x199.jpg 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><p id=\"caption-attachment-1559\" class=\"wp-caption-text\">Ahah. I'm so funny.<\/p><\/div>\n<p>This will probably slightly change as this component is heavily under works, but as of now this short plugin will do:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">php<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"php\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&lt;?php<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">\/*<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Plugin Name: No Admin Bar<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Plugin URI: http:\/\/planetozh.com\/blog\/2010\/10\/how-to-remove-wordpress-admin-bar\/<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Description: Remove the Admin Bar<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Author: Ozh<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Version: 1.0<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">Author URI: http:\/\/ozh.org\/<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">*\/<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">\/\/ Remove instantiation<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">add_filter<span style=\"color: #009900\">&#040;<\/span> <span style=\"color: #0000ff\">'show_admin_bar'<\/span><span style=\"color: #339933\">,<\/span> <span style=\"color: #0000ff\">'__return_false'<\/span> <span style=\"color: #009900\">&#041;<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">?&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>Either make this a regular plugin in <tt>wp-content\/plugins\/<\/tt> and activate it, or just drop it in <tt>wp-content\/mu-plugins\/<\/tt>.<\/p>\n<p><strong>Update<\/strong>: now a <a href=\"http:\/\/wordpress.org\/extend\/plugins\/disable-admin-bar\/\">downloadable plugin<\/a>.<\/p>\n<p><strong>Update 2<\/strong>: this was a sort of a proof of concept. Now that WordPress 3.1 is released and has a per-user option to disable it, this plugin is incomplete: if you want to disable the admin bar, also hide the option as <a href=\"http:\/\/developersmind.com\/2011\/02\/23\/disable-admin-bar-and-hide-preferences\/\">Pete Mall explains<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It will be a matter of personal preference or a matter of clients asking for it, but I bet this one is going to be a frequent question in the next months: &quot;How do I remove the Admin Bar?&quot;. This will probably slightly change as this component is heavily under works, but as of now [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[381,85,245],"class_list":["post-1558","post","type-post","status-publish","format-standard","hentry","category-published","tag-admin-bar","tag-plugins","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=1558"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1558\/revisions"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=1558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=1558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=1558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}