Admin notices are how WordPress communicates with users in the admin area. For plugin developers, notices are the primary way to display important information — update notifications, configuration warnings, license expiration alerts, and success messages after user actions.
Notice Types
WordPress provides four notice classes for different message types. notice-success displays a green message for successful operations. notice-warning shows a yellow message for cautionary information. notice-error displays a red message for errors. notice-info shows a blue message for neutral information. Choose the appropriate type for your message’s severity.
Displaying Notices
Display notices using the admin_notices action hook. Output HTML with the notice class and your message. Make notices dismissible by adding the is-dismissible class. Only show notices on relevant admin pages by checking the current screen with get_current_screen().
Transient-Based Notices
For notices that should appear on the next page load after an action — like “Settings saved” — store the notice message in a transient. On the next page load, display the notice from the transient and delete it. This pattern prevents notices from appearing on the wrong page or being shown multiple times.
Dismissible Notices
Add dismissible functionality to non-critical notices. The is-dismissible class enables the close button. WordPress stores dismissed notices in user meta. Check whether a notice has been dismissed before displaying it. For per-user dismissals, store dismissal status in user meta with update_user_meta().
Best Practices
Only show notices on relevant admin pages. Don’t overwhelm users with multiple notices at once. Use dismissible notices for information that users may want to hide. Use non-dismissible notices for critical information that requires action. Test notices on different screen sizes and in different admin contexts.
Il punto fondamentale
Admin notices are an integral part of the WordPress user experience. Use the appropriate notice type for your message, display notices on relevant pages only, implement transient-based notices for post-action messages, and respect user preferences with dismissible notices.




