Add Custom Info Widget to WordPress Admin Dashboard [code snippet]


Add Custom Info Widget to WordPress Admin Dashboard [code snippet]

The snippet below helps you customize the default WordPress admin dashboard. Sometimes the dashboard contains too much information and you want to simplify it for you or your clients. The code below will help you hide existing widgets and add a custom one. In this example I added a user guide to help new users learn how to add new content to the site.

Add code to the bottom of your themes functions.php

// disable default dashboard widgets
function disable_default_dashboard_widgets() {

    //remove_meta_box('dashboard_right_now', 'dashboard', 'core');
    remove_meta_box('dashboard_activity', 'dashboard', 'core');
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
    remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');
    remove_meta_box('dashboard_plugins', 'dashboard', 'core');

    remove_meta_box('dashboard_quick_press', 'dashboard', 'core');
    remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');
    remove_meta_box('dashboard_primary', 'dashboard', 'core');
    remove_meta_box('dashboard_secondary', 'dashboard', 'core');

    remove_meta_box('dashboard_site_health', 'dashboard', 'core');
    remove_meta_box('dashboard_right_now', 'dashboard', 'core');
    remove_meta_box('wpseo-dashboard-overview', 'dashboard', 'core');
    
}
add_action('admin_menu', 'disable_default_dashboard_widgets');

// Custom dashboard box
function custom_dashboard_widget() {
    echo 'Read the user guide: <a href="/wp-content/guide.pdf" target="_blank">View Guide</a>';
}
function add_custom_dashboard_widget() {
    wp_add_dashboard_widget('custom_dashboard_widget', 'Admin User Guide', 'custom_dashboard_widget');
}
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');

 


About the Author

Jacob Lett is the founder of Bootstrap Creative, a digital marketing consultancy that helps Michigan manufacturers generate qualified leads through HubSpot, technical SEO, and Google Ads. With over a decade of hands-on experience, he acts as a direct partner for B2B companies seeking measurable ROI from their marketing investment.



Related posts

Tags:

| Read My Editorial Policy

Want to Get Email Updates of New Articles?

Join My Email Newsletter