Adding Information, Tips and Sales Information for Clients to the WordPress Dashboard
If you’re building websites for clients using WordPress, you’ll be keen to find a way to maintain your relationship with them and keep in touch.
Update 7/3/18: Ultimate Branding 2.0 is here and comes stacked with an all new Coming Soon & Maintenance Mode builder, new modules for customizing WordPress system emails, social links for Author Boxes and a bunch of other upgrades. Check it out!
After all, a client who’s already hired you to build their website is someone who’s very likely to hire you again in the future or recommend you to their contacts.
There are plenty of ways to do this. A quarterly review of their site is a good way to add value to the relationship and identify any future work you need them to do. If you don’t go that far, a quarterly or monthly email or phone call touching base and checking that all’s well with their site is good. You may have a newsletter, or if you invoice your clients for hosting regularly that’s another way of keeping in touch. I probably get half of my repeat business after sending out an invoice!
It’s also a good idea to have contact with your clients that’s aimed at helping them manage their site and get the most from it. You might offer training or coaching, or maybe online tips. You could include advice in your newsletter. Or you might include video tutorials in the WordPress admin screens, using a plugin like our Video Tutorials plugin.
One of the easiest and probably most effective ways to communicate with your clients is via the WordPress dashboard. When they’re looking at those screens, they’re thinking about their website. They’ll be in the right frame of mind for tips to help them manage their site, and they may also be thinking about how they can improve their site and add more features to it, or maybe get a second site.
To help with this, you can add your own messages and tips to the dashboard. One way to do it is with our Ultimate Branding plugin, but if you want something more bespoke, you can code it yourself.
In this post I’ll show you how to do just that. I’ll show you how to add widgets, messages and metaboxes to the admin screens in the sites you develop to help your clients run their site and let them know where to come if they need help.
What You’ll Need
To follow along with this post, you’ll need:
- A development installation of WordPress (maybe running a client site that you’re developing).
- A code editor.
I’ll show you how to create a plugin to add items to the admin screens, instead of adding it to the theme. This is best practice as it means you can easily install the same plugin to multiple sites. You might have different versions of the plugin for different clients, in which case make sure you name them appropriately.
It’s also better doing this via a plugin than a theme because if the site should change its theme in the future, your admin messages will still be there.
Creating the Plugin
Start by creating your plugin in the usual way – here’s the code to set my plugin up:
If you’re not sure about creating a plugin, check out our guide to writing your first plugin.
Now your plugin is set up, activate it via the Plugins screen – remember you’re working on a development site so you mustn’t activate this in the live site until you’ve tested it.
Adding a Widget to the Dashboard
Let’s start with the main dashboard screen. When I’m creating a client site I always add a message here. This will have two aims:
- To help the client navigate their site and understand any customizations such as custom post types, taxonomies, etc.
- To let them know where to come if they need help or more work done on the site.
To add a widget, you use the
wp_add_dashboard_widget() function, which has three parameters:
- the unique name of your widget
- the title of the widget, which is what users will see on the dashboard screen
- the name of the callback function which will populate the widget – again, make this unique.
This needs to go inside another function which you hook to the
So here’s my function to create a ‘Welcome’ widget in the dashboard:
If I save that my widget won’t show anything, as it needs to be populated with that callback function. This is simply the content inside your widget, which you code in HTML. Here’s mine:
I’ve included paragraphs and lists in order to break the text up and make it easier to understand. As well as including instructions on custom post types added via plugins, I’ve included an overview of the post types and settings provided by WordPress. I think it makes sense to do all this in the same place, to save confusion. But if you want to limit your widget to including information about customizations, that’s fine.
Here’s my widget:
And that’s how you add a widget to the dashboard. Before you move on to the other screens, it’s useful to know how to remove widgets from the dashboard. Once you start adding new ones, you might find that things become a little cluttered, And there may be default widgets which aren’t useful for your clients. To do this, use the
remove_meta_box() function for each widget you want to remove. Here’s what I’ve done on my site, which removes a few widgets:
Try this with your own site, identifying those widgets you don’t want your clients seeing, or which aren’t useful to them.
Adding Helpful Metaboxes to Editing Screens
Another place to add help content is directly in your editing pages. I find that this helps users find help content quickly, as it’s right there on the screen. It’s especially useful for custom post types.
You can add a metabox to any editing screen and add a callback function to populate it with HTML. On one of my client sites, I added a metabox for products in their store. Here’s the code:
Firstly, that runs a function called
rmcc_add_product_help_text() which I hook to the
add_meta_boxes action hook. Inside it is the
add_meta_box() function, with five parameters:
- the id of the metabox
- the text to be displayed on the screen
- the callback function’s name
- the post type the meta box will appear on
- the position of the metabox
The callback function then contains the HTML to populate the metabox.
This will create a metabox that looks like this:
Adding High Priority Dashboard Messages
The above examples give your users helpful information. But what if you want to draw their attention to something and really make it stand out?
You can do this with dashboard messages.
If you host your client sites, you can add these on a timely basis to promote your products or services or encourage users to get in touch with you. And this is even easier if you host your client sites using WordPress Multisite.
When you have a new product or service you want to promote, for example, you could add a message to the dashboard with details. Just create a single plugin to do this and then activate it on all your sites.
In Multisite, you can network activate the plugin which means you only have to do this once.
Instead of using the functions we’ve used above, use the
admin_notices hook to add your code to the very top of the dashboard. Your function just needs to include the content of your admin notice, contained within a div element with the
And here it is on the dashboard:
Adding Custom Content to the Admin Screens will help Your Clients and Boost Your Business
Providing customized help content for your clients will help them work with their site more effectively without having to contact you with questions. And if you also add promotional messages, you can use the WordPress dashboard to keep in touch with your clients and sell your services to them.
Try adding some of the above to your clients’ sites and see how they respond.Tags: