How to Add Custom Dashboard Widgets in WordPress
There are tons of new themes coming out for WordPress every day, but none of them seems to utilize this feature. WordPress developers should add custom dashboard widget with support information. In this article we will show you how you can customize dashboard widgets in WordPress.
Simply open your functions.php file and add the following code:
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}function custom_dashboard_help() {
echo '<p>Welcome to Custom Blog Theme! Need help? Contact the developer <a href="mailto:yourusername@gmail.com">here</a>. For WordPress Tutorials visit: <a href="http://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';
}
Remember to change the email and add other useful information.
This code can be very helpful when creating custom themes for clients.
Result:

Comments
13 Responses to “How to Add Custom Dashboard Widgets in WordPress”Share Your Opinions
Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!
Please make sure that you have read our Comment Policy.











This is awesome thank you for sharing.
thanks for the tutorial.
please don’t take it wrong whenever you are going to post any article post it with the appropriate screen shot so that it will be easy for the newbie.
Interesting, I did all of that with the line below. Is one better, or are these both just as good?
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Contact',
));
}
Your code is for registering Sidebar Widgets. The code we are sharing in this article is to add custom dashboard widget. When one log in to their wp-admin, they see post stats, and other information. This box will be added there.
Two completely different topics.
wpmu. I have found /wp-includes/functions.php but where should I insert the code? Thanks for your help
You actually include this in your themes functions.php file not the core file.
what do u mean themes function.php?
i cannot find such a file
There is a functions.php file located in your theme’s folder.
when making two widgets how do you make them side by side instead of one on top one on bottom?
Hey Richard, You can make your widget be displayed at the very top using the code in WordPress Codex Dashboard API. We don’t know how to set them side by side without manually going in and saving it for the client. Perhaps sending an email to Jake and asking him would be a good idea.
Although remember, the settings you set in functions.php does not override the normal settings if the user has previously changed the settings. This only works if the user never organized his/her dashboard before.
Use display block on the outer most element and float left, make sure to set a width, but that may break it. This is very similar to a gallery layout. This is not suggested and not necessarily how WordPress designed widgets to be used (use at your own risk).
Worked like a charm. Using this as a workaround for one of my membership site that locked all dashboard menus; this will point members to the appropriate edit posts links again.
Wow! Never heard about that trick before… Very nice, thanks!