The code
Add the snippet bellow to your theme’s functions.php file.
add_action('wp_dashboard_setup', 'custom_dashboard_widgets');
function custom_dashboard_widgets(){
//first parameter is the ID of the widget (the div holding the widget will have that ID)
//second parameter is title (shown in the header of the widget) -> see picture bellow
//third parameter is the function name we are calling to get the content of our widget
wp_add_dashboard_widget('my_custom_widget_id', 'My Widget Title', 'my_custom_widget');
}
function my_custom_widget() {
//the content of our custom widget
echo '<p>The content of the widget goes here.</p>';
}
The outcome

What about multiple widgets?
add_action('wp_dashboard_setup', 'custom_dashboard_widgets');
function custom_dashboard_widgets(){
wp_add_dashboard_widget('my_custom_widget_id', 'My Widget Title', 'my_custom_widget');
wp_add_dashboard_widget('my_custom_widget_id_second', 'My Second Widget Title', 'my_second_custom_widget');
}
function my_custom_widget() {
echo '<p>The content of the widget goes here.</p>';
}
function my_second_custom_widget() {
echo '<p>The content of the second widget goes here.</p>';
}
Learn about wordpress plugins with 70-647 dumps. We offer complete collection of 70-290 dumps as well as 642-436 dumps to help you become master of whole technology.











I’ve used this method to provide clients with my contact information for support questions. You can also remove dashboard widgets that just add clutter. I wrote a little plug-in explanation on my site (Dashboard Support Widgets) in case people are wanting to take your code a bit further.
Thank God! Finding information about custom dashboard widgets isn’t that hard, but I really couldn’t figure out how to add more than just one. Thanks for showing how to do this. Now all I need to figure out is how to make some go into the right column, and not have all occupy the left one. Will report back here if I figure it out! Thanks again for this snippet.
Kristian
I have the same question as Kristian. How can we make a widget go on the right side?
This is a great post! I have found this to be very helpful and it seems to be working great.