How To Show Custom Notification Message In WordPress Admin Panel

Have you ever noticed alert and error notification messages in the top of your WordPress admin panel? It’s really easy to show your own custom notification message in your WordPress website’s admin panel by adding a little snippet from WordPress’ codex. There are two types of notifications – updated (green) & error (red).

Add following snippet to your current theme’s functions.php file:

function my_admin_notice() {
   echo ' <div class="updated">
                 <p>Your custom message!</p>
          </div>';
}
add_action( 'admin_notices', 'my_admin_notice' );

You can replaced updated div class with error class to show a custom error message.

If you found this post useful, share it with your friends:

3 thoughts on “How To Show Custom Notification Message In WordPress Admin Panel”

Leave a Reply