How to create a WordPress dashboard widget to list any custom HTML you want. Simple functions.php addition to add a WP dashboard widget to your blog.

Create a WordPress Dashboard Widget

Written by in Tutorials |

WordPress Dashboard Widget

WordPress Dashboard Widget

A standard WordPress install comes with a bunch of useful Dashboard widgets (Recent Drafts, Recent Comments, Right Now) and some that are damn near useless for certain people (Other WordPress News, WordPress Blog, QuickPress). However there is no simple way to add a widget of your own…or is there?

I like to add a widget with a few important links pertaining to the site I’m logged into at the time. I call it “Business Links” but you can call it whatever you’d like — you can even insert anything you want (PHP or HTML). Let’s get into it…

Add the WP Dashboard Widget

First we have to login via FTP and open up our functions.php file (custom_function.php for Thesis Theme users). Then we add the following code making changes where noted:

//ADD NEW DASHBOARD WIDGET
function new_dash_widget_function() { ?>
	<p>Hello. I'm a custom dashboard widget. You can replace this paragraph with any HTML or PHP to suit your needs.</p>
<?php }
function add_dashboard_widgets() {
wp_add_dashboard_widget('new_dash_widget', 'YOUR WIDGET TITLE', 'new_dash_widget_function');
}
add_action('wp_dashboard_setup', 'add_dashboard_widgets' );

That’s it. Add any content you want and change the title to whatever you’d like. Then login to your WP dashboard and behold the widgety-ness of …ah, whatever.

If you’ve taken part in our free WordPress blog setup service, we automatically add a dashboard widget called the Website Owners Toolbox. If you want to make changes, or delete it entirely, here’s how…

Hide It

If you want to keep the dashboard widget but don’t want it always cluttering up your dashboard you can hide/unhide it by clicking the Screen Options tab (top right of your WP dashboard) and checking it on or off.

Customize It

If you want to replace the content with your own content you can follow along in the preceding tutorial on this page or open up your functions.php file in your themes folder (custom_functions.php for Thesis users), and find the following code:

//BEGIN: Web Owners Toolbox Dashboard Widget
function web_toolbox_widget_function() { ?>
<?php /* Want to add your own info inside this box? Delete everything after this comment (until you reach the "STOP!" comment) and add your own HTML! */ ?>

Just follow the instructions on how to replace the current content with your own.

Delete It

If you want it gone entirely, open up your functions.php file in your themes folder (custom_functions.php for Thesis users), and delete everything between these two comments (including the comments themselves):

//BEGIN: Web Owners Toolbox Dashboard Widget
     ...bunch of code...
//END: Web Owners Toolbox Dashboard Widget

If you don’t like touching code, just let us know and we’ll do it for you.

Enjoy this post? Consider sharing it: