21 Most Useful WordPress Admin Page Hacks

WordPress needs no introduction among designers and writers. It use to known as the synonym for blogging but now days it is used to create any type of website of any complexity. WordPress has reached phenomenally high usage rates. There are over 70 million publishers who use WordPress, making it a popular publishing platform. These days every other WordPress blogs look more or less similar, to stand uniquely, you need to tweak it using quality hacks.

You all must’ve known that the new version v3.3.1 is already arrived and most of you going to update (or already updated) your WordPress to v3.3.1 anyway. So, it’s a right time to implement some new hacks also.

Of Course, WordPress Codex is always the best place to learn about WordPress and its tweaks. But unfortunately, it’s too much for a simple WordPress user. This the only reason we compiled this fairly comprehensive list of the Quality WordPress Hacks to unleash the power of your favorite blogging engine.

One of the greatest things about blogging is the immediate feedback a blogger can get from his readers. Still it’s often possible that your readers don’t give you clear idea about their likes and dislikes. Unfortunately, there is no way to find out about visitors thinking about your blog. It’s always essential to play safe and give others what they like. This article focuses on organized collection of some of the Most Useful WordPress Hacks for your Admin Panel which will definitely make your blogging life easier.

You may be interested in the following related articles as well.

Feel free to join us and you are always welcome to share your thoughts that our readers may find helpful.

Don’t forget to subscribe to our RSS-feed and follow us on Twitter — for recent updates.

How to disable dragging of metaboxes in admin panel

instantShift - Useful WordPress Admin Page Hacks

If you want to disable the functionality of dragging of metaboxes within the admin area and dashboard so the meta boxes can’t be repositioned then you need to deactivate the JS for this function. Go to functions.php in your theme folder and add following code.

function disable_drag_metabox() {
    ks29so_deregister_script('postbox');
}
add_action( 'admin_init', 'disable_drag_metabox' );

 

Show an urgent message in the WordPress admin panel

instantShift - Useful WordPress Admin Page Hacks

When applying changes to the theme or plugins, you might want to inform users that something important needs doing, or you want to inform other admins to not to perform any changes while you are working on specific file. Following steps shows you how to add a error or status message via adding some code to your theme’s functions.php.

Just change the string in line 14 to put the desired notification or error message.

function showMessage($message, $errormsg = false)
{
	if ($errormsg) {
		echo '<div id="message" class="error">';
	}
	else {
		echo '<div id="message" class="updated fade">';
	}
	echo "<p><strong>$message</strong></p></div>";
} 

function showAdminMessages()
{
    showMessage("Working on Theme's function.php, Do not touch it till further notice.", true);
}
add_action('admin_notices', 'showAdminMessages');

 

How to show admin bar only for admins

instantShift - Useful WordPress Admin Page Hacks

Adding the following code into your theme’s functions.php file will only allow admins to see the admin bar.

if (!current_user_can('manage_options')) {
	add_filter('show_admin_bar', '__return_false');
}

 

How to remove menu items from admin bar (on top)

instantShift - Useful WordPress Admin Page Hacks

This hack gives you flexibility to remove the menu items from the admin bar in top section of your WordPress admin area. Go to functions.php in your theme folder and add following code.

function wps_admin_bar() {
    global $ks29so_admin_bar;
    $ks29so_admin_bar->remove_menu('wp-logo');
    $ks29so_admin_bar->remove_menu('about');
    $ks29so_admin_bar->remove_menu('wporg');
    $ks29so_admin_bar->remove_menu('documentation');
    $ks29so_admin_bar->remove_menu('support-forums');
    $ks29so_admin_bar->remove_menu('feedback');
    $ks29so_admin_bar->remove_menu('view-site');
}
add_action( 'ks29so_before_admin_bar_render', 'wps_admin_bar' );

 

Replace “Howdy, admin” in WordPress admin bar

instantShift - Useful WordPress Admin Page Hacks

Some people might find this silly but there are many who wants to replace the notification “Howdy, admin” from the admin bar of admin area. To do so, following code needs to be dropped into your theme’s functions.php file.

function replace_howdy( $ks29so_admin_bar ) {
    $my_account=$ks29so_admin_bar->get_node('my-account');
    $newtitle = str_replace( 'Howdy,', 'Logged in as', $my_account->title );            
    $ks29so_admin_bar->add_node( array(
        'id' => 'my-account',
        'title' => $newtitle,
    ) );
}
add_filter( 'admin_bar_menu', 'replace_howdy',25 );

 

Hide ‘help’ Tab from admin panel

instantShift - Useful WordPress Admin Page Hacks

I’ve never used the The ‘help’ tab in the top right corner of the WordPress admin area and this function is most of the time unnecessary for your clients too. With some simple CSS it’s possible to hide this tab.

Go to theme’s functions.php and add following code.

function hide_help() {
    echo '<style type="text/css">
            #contextual-help-link-wrap { display: none !important; }
          </style>';
}
add_action('admin_head', 'hide_help');

 

How to add new items to admin bar

instantShift - Useful WordPress Admin Page Hacks

Add following code to your theme’s functions.php and you can easily able to add new items to admin bar.

function ks29so_admin_bar_new_item() {
global $ks29so_admin_bar;
$ks29so_admin_bar->add_menu(array(
'id' => 'wp-admin-bar-new-item',
'title' => __('iShift Archive'),
'href' => 'http://www.instantshift.com/archive/'
));
}
add_action('ks29so_before_admin_bar_render', 'ks29so_admin_bar_new_item');

 

How to remove menu items from WordPress admin panel/dashboard

instantShift - Useful WordPress Admin Page Hacks

WordPress admin panel comes with a lot of options in the left side menu, but you can get rid of them easily if required. This hack gives you flexibility to remove the menu items from the admin panel.

just paste the following code in your theme’s functions.php file.

add_action( 'admin_menu', 'remove_links_menu' );
function remove_links_menu() {
     remove_menu_page('index.php'); // Dashboard
     remove_menu_page('edit.php'); // Posts
     remove_menu_page('upload.php'); // Media
     remove_menu_page('link-manager.php'); // Links
     remove_menu_page('edit.php?post_type=page'); // Pages
     remove_menu_page('edit-comments.php'); // Comments
     remove_menu_page('themes.php'); // Appearance
     remove_menu_page('plugins.php'); // Plugins
     remove_menu_page('users.php'); // Users
     remove_menu_page('tools.php'); // Tools
     remove_menu_page('options-general.php'); // Settings
}

 

Remove the Editor submenu item from Appearance menu

instantShift - Useful WordPress Admin Page Hacks

Removing a editor submenu from the Appearance menu is a bit tricky as it doesn’t respond to the unset() function. Use following hack to remove it from Appearance menu.

function remove_editor_menu() {
  remove_action('admin_menu', '_add_themes_utility_last', 101);
}

add_action('_admin_menu', 'remove_editor_menu', 1);

 

Change WordPress version in admin footer

instantShift - Useful WordPress Admin Page Hacks

Adding this code in your theme’s functions.php will change the version string in the bottom-right of the WordPress admin pages.

function change_footer_version() {
  return 'Version 1.0.0';
}
add_filter( 'update_footer', 'change_footer_version', 9999 );

 

Change footer text in WordPress admin panel

instantShift - Useful WordPress Admin Page Hacks

Adding this code in your theme’s functions.php will change the footer text to anything you like it to be. Just change the “My Custom footer text” string with your choice.

function remove_footer_admin () {
  echo 'My Custom footer text.';
}
add_filter('admin_footer_text', 'remove_footer_admin');

 

How to display dashboard in a single column only

instantShift - Useful WordPress Admin Page Hacks

Adding this code to the functions.php of your WordPress theme will force the WordPress admin dashboard to display in a single column only.

function single_screen_columns( $columns ) {
    $columns['dashboard'] = 1;
    return $columns;
}
add_filter( 'screen_layout_columns', 'single_screen_columns' );
function single_screen_dashboard(){return 1;}
add_filter( 'get_user_option_screen_layout_dashboard', 'single_screen_dashboard' );

 

How to disable browser upgrade notification/warning

instantShift - Useful WordPress Admin Page Hacks

Many of you may have noticed the browser upgrade notification / warning on your admin panel deshboard. If you simply want to get rid of these notification / warning then add following code in your theme’s functions.php file.

function disable_browser_upgrade_warning() {
    remove_meta_box( 'dashboard_browser_nag', 'dashboard', 'normal' );
}
add_action( 'ks29so_dashboard_setup', 'disable_browser_upgrade_warning' );

 

How to add custom pointers in admin area

instantShift - Useful WordPress Admin Page Hacks

Many of you may have noticed pointers in your WordPress admin panel. Pointers are useful if you want to provide guidelines to your users about your theme or plugin within your admin area.

Adding following code in your theme’s functions.php file will allow you to add pointer within your admin area.

Don’t forget to put the desired label and message on line 8 & 9.

Also update the ID with jquery to assign the pointer in place of #menu-appearance in line 14. For example if you want your pointer’s tooltip to point towards media menu then use id #menu-media instead of #menu-appearance or in case of settings menu use id #menu-settings

add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' );
function my_admin_enqueue_scripts() {
    ks29so_enqueue_style( 'wp-pointer' );
    ks29so_enqueue_script( 'wp-pointer' );
    add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );
}
function my_admin_print_footer_scripts() {
    $pointer_content = '<h3>iShift | Notice</h3>';
    $pointer_content .= '<p>Added new functions to Edit Post section and few more options for users (authors and subscribers only).</p>';
?>
   <script type="text/javascript">
   //<![CDATA[
   jQuery(document).ready( function($) {
    $('#menu-appearance').pointer({
        content: '<?php echo $pointer_content; ?>',
        position: 'top',
        close: function() {
            // Once the close button is hit
        }
      }).pointer('open');
   });
   //]]>
   </script>
<?php
}

 

Show the count of pingbacks & trackbacks within admin post columns

instantShift - Useful WordPress Admin Page Hacks

This hack simply adds a new column called counts within the admin post columns which display the total number of pingbacks and trackbacks for each post.

Go to functions.php in your theme folder and add following code.

function commentCount($type = 'comments'){
	if($type == 'trackbacks'):
		$typeSql = 'comment_type = "trackback"';
		$oneText = 'One :trackback';
		$moreText = '% :trackbacks';
		$noneText = 'No :trackbacks';
	elseif($type == 'pingbacks'):
		$typeSql = 'comment_type = "pingback"';
		$oneText = 'One :pingback';
		$moreText = '% :pingbacks';
		$noneText = 'No :pingbacks';
	endif;
	global $wpdb;
    $result = $wpdb->get_var('
        SELECT
            COUNT(comment_ID)
        FROM
            '.$wpdb->comments.'
        WHERE
            '.$typeSql.' AND
            comment_approved="1" AND
            comment_post_ID= '.get_the_ID()
    );
	if($result == 0):
		echo str_replace('%', $result, $noneText);
	elseif($result == 1):
		echo str_replace('%', $result, $oneText);
	elseif($result > 1):
		echo str_replace('%', $result, $moreText);
	endif;
}
add_filter('manage_posts_columns', 'posts_columns_counts', 1);
add_action('manage_posts_custom_column', 'posts_custom_columns_counts', 1, 2);
function posts_columns_counts($defaults){
    $defaults['wps_post_counts'] = __('Counts');
    return $defaults;
}
function posts_custom_columns_counts($column_name, $id){
	if($column_name === 'wps_post_counts'){
		commentCount('trackbacks'); echo "<br />";
		commentCount('pingbacks');
          }
}

 

How to show post attachment count in admin column

instantShift - Useful WordPress Admin Page Hacks

Adding this code to the functions.php of your WordPress theme will display the post attachment count in a custom admin column.

add_filter('manage_posts_columns', 'posts_columns_attachment_count', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns_attachment_count', 5, 2);
function posts_columns_attachment_count($defaults){
    $defaults['wps_post_attachments'] = __('Att');
    return $defaults;
}
function posts_custom_columns_attachment_count($column_name, $id){
	if($column_name === 'wps_post_attachments'){
	$attachments = get_children(array('post_parent'=>$id));
	$count = count($attachments);
	if($count !=0){echo $count;}
    }
}

 

How to add featured image thumbnail to WordPress admin columns

instantShift - Useful WordPress Admin Page Hacks

The admin pages listing the site’s posts and pages come with various text columns like title, tags, categories, author and so on. In order to see what the featured images are, you have to visit each post or page individually. Using this hack you can add a column with a reasonably sized thumbnail copy of the featured image. Please note that this only works for themes that support featured images.

Just add following code to your theme’s functions.php file.

// Add the posts and pages columns filter. They can both use the same function.
add_filter('manage_posts_columns', 'tcb_add_post_thumbnail_column', 5);
add_filter('manage_pages_columns', 'tcb_add_post_thumbnail_column', 5);

// Add the column
function tcb_add_post_thumbnail_column($cols){
  $cols['tcb_post_thumb'] = __('Featured');
  return $cols;
}

// Hook into the posts an pages column managing. Sharing function callback again.
add_action('manage_posts_custom_column', 'tcb_display_post_thumbnail_column', 5, 2);
add_action('manage_pages_custom_column', 'tcb_display_post_thumbnail_column', 5, 2);

// Grab featured-thumbnail size post thumbnail and display it.
function tcb_display_post_thumbnail_column($col, $id){
  switch($col){
    case 'tcb_post_thumb':
      if( function_exists('the_post_thumbnail') )
        echo the_post_thumbnail( 'admin-list-thumb' );
      else
        echo 'Not supported in theme';
      break;
  }
}

 

How to hide admin post meta-boxes

instantShift - Useful WordPress Admin Page Hacks

On may places you need to provide clean or simplify WordPress admin interface for your clients. Following hack provides you facility to hide meta boxes of post section in Admin area.

Add this code to your WordPress theme’s functions.php file.

add_action( 'admin_menu', 'remove_meta_boxes' );
function remove_meta_boxes() {
	remove_meta_box( 'submitdiv', 'post', 'normal' ); // Publish meta box
	remove_meta_box( 'commentsdiv', 'post', 'normal' ); // Comments meta box
	remove_meta_box( 'revisionsdiv', 'post', 'normal' ); // Revisions meta box
	remove_meta_box( 'authordiv', 'post', 'normal' ); // Author meta box
	remove_meta_box( 'slugdiv', 'post', 'normal' );	// Slug meta box
	remove_meta_box( 'tagsdiv-post_tag', 'post', 'side' ); // Post tags meta box
	remove_meta_box( 'categorydiv', 'post', 'side' ); // Category meta box
	remove_meta_box( 'postexcerpt', 'post', 'normal' ); // Excerpt meta box
	remove_meta_box( 'formatdiv', 'post', 'normal' ); // Post format meta box
	remove_meta_box( 'trackbacksdiv', 'post', 'normal' ); // Trackbacks meta box
	remove_meta_box( 'postcustom', 'post', 'normal' ); // Custom fields meta box
	remove_meta_box( 'commentstatusdiv', 'post', 'normal' ); // Comment status meta box
	remove_meta_box( 'postimagediv', 'post', 'side' ); // Featured image meta box	
	remove_meta_box( 'pageparentdiv', 'page', 'side' ); // Page attributes meta box
}

 

Hide admin color scheme options from user profile

instantShift - Useful WordPress Admin Page Hacks

Adding this code to your theme’s functions.php will hide the admin color scheme from the user profile page in admin section.

function admin_color_scheme() {
   global $_wp_admin_css_colors;
   $_wp_admin_css_colors = 0;
}
add_action('admin_head', 'admin_color_scheme');

 

How to change WordPress admin and login page logo

instantShift - Useful WordPress Admin Page Hacks

This one’s an old trick, but a still and good one. You can change the logo for the login page and the WordPress Admin area pages.

To change the login page logo then simply add following code to your theme’s functions.php file. Don’t forget to change the logo location in line 3.

function my_custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url('.get_bloginfo('template_url').'/images/login_page_logo.png) !important; }
    </style>';
}

add_action('login_head', 'my_custom_login_logo');

To change the WordPress Admin area logo (the one which located in the top left side of your Admin panel) then simply add following code to your theme’s functions.php file. Again, Don’t forget to change the logo location in line 3.

function custom_logo() {
  echo '<style type="text/css">
    #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/admin_page_logo.png) !important; }
    </style>';
}

add_action('admin_head', 'custom_logo');

 

Change WordPress default FROM email address

Adding this code into your theme’s functions.php file will change the WordPress default FROM email address, as by default, you can’t modify the FROM email adress. Don’t forget to put the desired email address on line 5 (in place of ‘admin@yourdomain.com’) and desired name on line 8 (in place of ‘Your Blog Name’).

add_filter('ks29so_mail_from', 'new_mail_from');
add_filter('ks29so_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
 return 'admin@yourdomain.com';
}
function new_mail_from_name($old) {
 return 'Your Blog Name';
}

Find Something Missing?

Feel free to share any hack that you think would be a great addition in this article and that has not been listed already.

Like the article? Share it.

LinkedIn Pinterest

60 Comments

  1. very informative article about wordpress admin section.

  2. Now that is something really Awesome out there. Thanks for the share Buddy :) You’re making the Bloggers, to learn some Real Hacks ;)

  3. This will definitely make your blogging life easier.

  4. Informative article. Very useful for the WP admin section hacks.

  5. Very useful hacks! It’s a very nice idea to collect sush helpful hack in a post :)
    Thanks DKumar.

  6. This is a very useful article for WordPress users. Thanks for all the great article.

  7. just WOW!!

  8. Nice informative article.Really useful for admin section to collect WordPress hack.

  9. There is one I’m kid of struggle to find – I would like to change word “Post” in dashboard. I’ve got site where posts are descriptions of only one type of things.
    Anyone ?

    • Years later, but for anyone who wants the answer to thus, use Admin Menu Editor Pro. It’s a great plugin for customizing the admin. (no affiliation, just love the plugin)

  10. Thank you. This stuff can be really useful for customizing client sites.

  11. Thanks for posting those hacks, very helpful.

  12. “How to disable browser upgrade notification/warning” – this is my favorite one :) Clients often use old versions of Internet Explorer. Nothing can make them update it and in the same time they want the warning message OFF. Thank you for this fix. I will definitely use it!

  13. Fantastic! These are so much better than the usual “run of the mill” hacks than the usual blog posts. Well done for collating them.

  14. This is a very useful article for WordPress users. Thanks for all the great article.

  15. Gah, this is so useful I’m going to explode! I’ve integrated it into my Base Framework for easy customization for all future sites.

    Thank you!!

  16. this is really worth of hacks tutorials

  17. That is one good collection of neat tricks. Thanks!

  18. Very very helpful info. Good to customize WP Admin as I design alot of sites for customers. Many thanks :)

  19. Thanks for posting, those are very useful for me! :)

  20. Do any body know “How to assign custom URL to admin logout” ?

  21. Amazing! Thanks!

  22. Very good hacks!! my question:
    On hack “How to add custom pointers in admin area” , how can I show the ballon only when the related menu is opened, or only when i put the mouse over the menu?

  23. Excellent post, thanks for this

  24. very nice post and helpful for beginners like me.i am planning to do a small project in wp using its backend.it will be very useful to know how to customize the add new post area without effecting the core files.

  25. This blog helped me a lot to be more professional while working on wordpress theme. Thanks for such posts and hope to get more help from the site in near future too.

  26. very impressive article

  27. Many thanks for this really helpful and informative article. There was a lot of new stuff in for me I am eager to try!

  28. Nice hook tips for WordPress.

    I have also made a plugin to remove the footer text and version in the admin control panel. This is very simple plugin and mainly based on hooks only. I have submitted it to the WordPress plugin repository too or you can also checkout.

    Thanks

  29. Oooo! Lots of fun hacks to play with!! Thanks much! (=^_^=)

  30. “But unfortunately, it’s too much for a simple WordPress user”
    these words like just for me.
    I used three of them under the function.php
    I think I done everything that you say buy nothing seems to work for me.
    have i done something wrong? here is how i put codes

    function remove_footer_admin () {
    echo ‘you can say hi to me here’;
    }
    add_filter(‘admin_footer_text’, ‘remove_footer_admin’);
    function commentCount($type = ‘comments’){
    if($type == ‘trackbacks’):
    $typeSql = ‘comment_type = “trackback”‘;
    $oneText = ‘One :trackback’;
    $moreText = ‘% :trackbacks’;
    $noneText = ‘No :trackbacks’;
    elseif($type == ‘pingbacks’):
    $typeSql = ‘comment_type = “pingback”‘;
    $oneText = ‘One :pingback’;
    $moreText = ‘% :pingbacks’;
    $noneText = ‘No :pingbacks’;
    endif;
    global $wpdb;
    $result = $wpdb->get_var(‘
    SELECT
    COUNT(comment_ID)
    FROM
    ‘.$wpdb->comments.’
    WHERE
    ‘.$typeSql.’ AND
    comment_approved=”1” AND
    comment_post_ID= ‘.get_the_ID()
    );
    if($result == 0):
    echo str_replace(‘%’, $result, $noneText);
    elseif($result == 1):
    echo str_replace(‘%’, $result, $oneText);
    elseif($result > 1):
    echo str_replace(‘%’, $result, $moreText);
    endif;
    }
    add_filter(‘manage_posts_columns’, ‘posts_columns_counts’, 1);
    add_action(‘manage_posts_custom_column’, ‘posts_custom_columns_counts’, 1, 2);
    function posts_columns_counts($defaults){
    $defaults[‘wps_post_counts’] = __(‘Counts’);
    return $defaults;
    }
    function posts_custom_columns_counts($column_name, $id){
    if($column_name === ‘wps_post_counts’){
    commentCount(‘trackbacks’); echo “”;
    commentCount(‘pingbacks’);
    }
    }
    function my_custom_login_logo() {
    echo ‘
    h1 a { background-image:url(‘.get_bloginfo(‘/wp-content/themes/SimpleJust’).’/images/login_page_logo.png) !important; }
    ‘;
    }

    add_action(‘login_head’, ‘my_custom_login_logo’);

  31. After disable admin bar, i need a change profile page for web site. So user can change profile with site itself, he need not to come to dashboard. How can i do so. Please reply

  32. After hiding a category, and it’s posts, from the site admin in a multisite network, I would like to build a form in a dashboard widget where the site admin can enter a new page title, upload a new featured image and thumbnail, and insert new page content, leaving the slug unchanged.

    Any suggestions?

  33. Forgot to thank you for the hacks. I’ve implemented several, and they work great. Good detail for someone as inept at code as me!

  34. What a great article! I’ve followed the tut about: Show an urgent message in the WordPress admin panel.

    How would I go about adding code so the user could dismiss the notice?

    Thanks!

  35. Very useful advices! Thank you dude! :)

  36. Great!, Very useful article. Thanks very much for share

  37. Very useful post. i try it on my Blog and i get a good result.

  38. Thank you for these. Very useful.

  39. So may thanks.

  40. Hey, This is what I was looking for . I Really appreciate your effort. Thanks a lot.
    Moreover, even better, if i can see something like Changing wp-admin to some other place, it would be a great help .

  41. Very useful information about wordpress. Building themes right now and this tips are most valued ! Thank you !!!

  42. Great article.
    I was looking for how to add new item to admin bar i am happy to see here but the problem is i want to add the new item on the right side of the bar.
    Is there any possibility i could float new item to right??

  43. So many thanks.God bless u.
    Great Article

  44. Simply: wow!
    thanks

  45. If you are looking for a plugin with most of these hacks check out wpquickadminthemes.com

  46. Is there a way to force the max length at wich the “Read More” tag can be placed? For example, I could set the max char length of the read more tag to 300 letters and if the user puts the “Read More” in character 301 the WordPress Editor will display some error message or something like that.

    Thanks!

  47. Before I leave, I to know on about the best alternative to the code: custom_color functionality.

  48. This is simply awesome. Everything in one place. Thank you for posting these hacks, man.

    Karl

  49. Thank you very much!
    Excellent posting excelent tips

  50. Great! It’s needed for me.

  51. Very good article.
    I preffer to use admin themes to impress my clients that are already working with wordpress and know how boring default theme can be. :)

    Keep up with good info and thanks.

  52. Very useful, thank you! :)

Leave a Comment Yourself

Your email address will not be published. Required fields are marked *