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

Add a Custom Admin Notice in WordPress

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

3 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 any WordPress admin page to see the notice.

Hook Used

– admin_notices — Displays a notice in the WordPress admin area.

Type: WordPress Admin Customization

Output: An informational notice appears at the top of admin pages for administrators. It can be dismissed for the current page view.

Customize: Replace the reminder text with your own message.

function custom_admin_notice_message() {
    if ( ! current_user_can( 'manage_options' ) ) {
        return;
    }

    echo '<div class="notice notice-info is-dismissible">';
    echo '<p><strong>Reminder:</strong> Please review your website content regularly.</p>';
    echo '</div>';
}
add_action( 'admin_notices', 'custom_admin_notice_message' );

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