How to remove the WordPress Admin from v3.x.x

Wordpress 3.x.x version came with a visible change that you might have noticed. It is nothing but a new admin bar in WordPress 3.xx that shows up when you are logged in as a subscriber or above. This might be useful on some websites and for most this is just an annoyance and makes the site look too generically ‘WordPress’ or detracts from existing functionality that you may have added, such as search adaptations. Wordpress

Not to mention a bunch of codes and scripts that will slow the response time of your website.

So with that in mind here is a bunch of samples that you can add to your functions.php or header.php if you prefer, to remove this option of Admin Bar in WordPress 3.1 and above.

Remember, don’t need to add both the codes, only use any one of the codes.

For your functions.php

if (!is_admin() && !current_user_can(‘add_users’)){

wp_deregister_script( ‘admin-bar’ );

wp_deregister_style( ‘admin-bar’ );

remove_action(‘wp_footer’,’wp_admin_bar_render’,1000);

}

For your header.php (place before <?php wp_head() ?> in header.php)

<?php

if (!current_user_can(‘add_users’)){

wp_deregister_script( ‘admin-bar’ );

wp_deregister_style( ‘admin-bar’ );

remove_action(‘wp_footer’,’wp_admin_bar_render’,1000);

}

?>

There are some Plugins available in WordPress to do this, but Plugins might slow down your WordPress install slightly more. But here, putting this code directly into your header.php which is the most efficient placement as it only loads for front-end-pages, or in to your functions.php file which is the given standard.

But, here we mentioned 4 WordPress Plugins to do this Job only if you are not confident with these php codes:

  1. Admin Bar Disabler
  2. Custom Admin Bar
  3. Global Hide/Remove Admin Bar Plug-in
  4. Admin Bar Removal

I hope this small tutorial will help you to get rid of the admin bar, if it is really annoying you. You can go for the dedicated Plugins to complete this task or you can manually insert these codes in your theme templates. If you like this tutorial, then do not forget to share it with your friends on Facebook & Twitter.

About The Author:

Shalool A.K. is the Founder/Editor at TekNoise.com and AndroidBeast.com, where he writes about Samsung Galaxy S 3 and free games for kindle fire





Leave a Reply