How to Add Custom Dashboard Widgets in WordPress

190

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 add this code to your theme’s functions.php file or a site-specific plugin.

  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="" 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:

Custom dashboard widget in WordPress

We hope this article helped you learn how to add custom dashboard widget in WordPress. You may also want to see our guide on how to remove unnecessary items from WordPress admin area.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.