Sunday 12 May 2013

Easiest Way To Remove WordPress Logo From Admin Bar

Important: All scripts hosted on widcraft.googlecode.com don't work anymore because Google has blocked that SVN repository.

Today, I'm going to share the easiest way to remove this annoying WordPress logo/links from your admin bar without using any plugin.

Last month, I tried to remove this whole WP logo menu from my site by editing those hard php files, and I was successful in it. But it was a temporary success, because soon I saw an error message on my dashboard.

Now, let me share two simple ways to remove that annoying thing from your admin bar.

Easiest Way: By Using CSS:

It's funny, but you can also remove that logo menu by adding display:none; CSS property. I know some of you guys are screwed up over this fact. Let me show you how. I'm using this CSS hack on this WP site.

  • Visit your File Manager or FTP from your hosting provides. Mine is from GoDaddy, which looks something like this:


  • Now in your file manger, visit webroot/wp-includes/css/admin-bar.min.css
  • In admin-bar.min.css, add following css code:

li#wp-admin-bar-wp-logo.menupop{display:none;}

  • Save/Update your admin-bar.min.css file and that's it.

Important: You may have to clear your browser's cache to see this change or you can use private window to see this simple css hack.

By Using php:

If you're not satisfied with our css hack, then you can also use php snippet to hide this menu list. Credits for this snippet goes to WP-Snippets.

  • Add this code to your functions.php file to remove the WordPress logo on admin bar:

<?php
function annointed_admin_bar_remove() {
        global $wp_admin_bar;

        /* Remove their stuff */
        $wp_admin_bar->remove_menu('wp-logo');
}

add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);
?>

That's it...Don't forget to leave a comment.
Important: Check our new website TricksPanda.com for WordPress tutorials, plugins and more.
 
Powered by Blogger.