The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · PHP

Add a Custom Dashboard Widget in WordPress

Shared by Amit Dholiya · October 9, 2026 · @wp_dashboard_setup

5 views
1 upvote
Back to Snippets

Steps

  1. Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin.

  2. Save and activate the snippet.

  3. Open WordPress Admin → Dashboard.

Hook Used

– wp_dashboard_setup — Registers the custom dashboard widget.

Type: WordPress Admin Customization

Output: A new Website Management Tips widget appears on the WordPress dashboard.

Customize: Change the widget title and the text inside custom_dashboard_widget_content() to display your own message.

function custom_dashboard_widget_content() {
    echo '<p>Welcome to your WordPress dashboard!</p>';
    echo '<p>Remember to update your content and check website performance regularly.</p>';
}

function custom_register_dashboard_widget() {
    wp_add_dashboard_widget(
        'custom_dashboard_widget',
        'Website Management Tips',
        'custom_dashboard_widget_content'
    );
}

add_action( 'wp_dashboard_setup', 'custom_register_dashboard_widget' );

Tested on

WordPress 6.8

Reported by the author on October 9, 2026. WPFolks has not verified this.

Not tested against WordPress 7.1.3. It may still work.

Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments