Title: wp_admin_notice
Published: November 8, 2023
Last modified: August 20, 2026

---

# wp_admin_notice( string $message, array $args = array() )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#wp--skip-link--target)

Outputs an admin notice.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#parameters)󠁿

 `$message`stringrequired

The message to output.

`$args`arrayoptional

An array of arguments for the admin notice.

 * `type` string
 * Optional. The type of admin notice.
    For example, `'error'`, `'success'`, `'warning'`,`'
   info'`.
 * `dismissible` bool
 * Optional. Whether the admin notice is dismissible. Default false.
 * `id` string
 * Optional. The value of the admin notice’s ID attribute.
 * `additional_classes` string[]
 * Optional. A string array of class names.
 * `attributes` string[]
 * Optional. Additional attributes for the notice div.
 * `paragraph_wrap` bool
 * Optional. Whether to wrap the message in paragraph tags. Default true.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#source)󠁿

    ```php
    function wp_admin_notice( $message, $args = array() ) {
    	/**
    	 * Fires before an admin notice is output.
    	 *
    	 * @since 6.4.0
    	 *
    	 * @param string $message The message for the admin notice.
    	 * @param array  $args    The arguments for the admin notice.
    	 */
    	do_action( 'wp_admin_notice', $message, $args );

    	echo wp_kses_post( wp_get_admin_notice( $message, $args ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/functions.php#L9307)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/functions.php#L9307-L9319)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#hooks)󠁿

 [do_action( ‘wp_admin_notice’, string $message, array $args )](https://developer.wordpress.org/reference/hooks/wp_admin_notice/)

Fires before an admin notice is output.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_admin_notice()](https://developer.wordpress.org/reference/functions/wp_get_admin_notice/)`wp-includes/functions.php` |

Creates and returns the markup for an admin notice.

  | 
| [wp_kses_post()](https://developer.wordpress.org/reference/functions/wp_kses_post/)`wp-includes/kses.php` |

Sanitizes content for allowed HTML tags for post content.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#)

| Used by | Description | 
| [WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies()](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/display_admin_notice_for_unmet_dependencies/)`wp-includes/class-wp-plugin-dependencies.php` |

Displays an admin notice if dependencies are not installed.

  | 
| [WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies()](https://developer.wordpress.org/reference/classes/wp_plugin_dependencies/display_admin_notice_for_circular_dependencies/)`wp-includes/class-wp-plugin-dependencies.php` |

Displays an admin notice if circular dependencies are installed.

  | 
| [deactivated_plugins_notice()](https://developer.wordpress.org/reference/functions/deactivated_plugins_notice/)`wp-admin/includes/plugin.php` |

Renders an admin notice when a plugin was deactivated during an update.

  | 
| [core_auto_updates_settings()](https://developer.wordpress.org/reference/functions/core_auto_updates_settings/)`wp-admin/update-core.php` |

Display WordPress auto-updates settings.

  | 
| [WP_MS_Themes_List_Table::column_autoupdates()](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/)`wp-admin/includes/class-wp-ms-themes-list-table.php` |

Handles the auto-updates column output.

  | 
| [paused_themes_notice()](https://developer.wordpress.org/reference/functions/paused_themes_notice/)`wp-admin/includes/theme.php` |

Renders an admin notice in case some themes have been paused due to errors.

  | 
| [wp_recovery_mode_nag()](https://developer.wordpress.org/reference/functions/wp_recovery_mode_nag/)`wp-admin/includes/update.php` |

Displays a notice when the user is in recovery mode.

  | 
| [paused_plugins_notice()](https://developer.wordpress.org/reference/functions/paused_plugins_notice/)`wp-admin/includes/plugin.php` |

Renders an admin notice in case some plugins have been paused due to errors.

  | 
| [WP_Privacy_Policy_Content::notice()](https://developer.wordpress.org/reference/classes/wp_privacy_policy_content/notice/)`wp-admin/includes/class-wp-privacy-policy-content.php` |

Adds a notice with a link to the guide when editing the privacy policy page.

  | 
| [WP_Privacy_Policy_Content::policy_text_changed_notice()](https://developer.wordpress.org/reference/classes/wp_privacy_policy_content/policy_text_changed_notice/)`wp-admin/includes/class-wp-privacy-policy-content.php` |

Outputs a warning when some privacy info has changed.

  | 
| [WP_Widget_Media_Audio::render_control_template_scripts()](https://developer.wordpress.org/reference/classes/wp_widget_media_audio/render_control_template_scripts/)`wp-includes/widgets/class-wp-widget-media-audio.php` |

Render form template scripts.

  | 
| [WP_Widget_Media_Video::render_control_template_scripts()](https://developer.wordpress.org/reference/classes/wp_widget_media_video/render_control_template_scripts/)`wp-includes/widgets/class-wp-widget-media-video.php` |

Render form template scripts.

  | 
| [WP_Widget_Media_Image::render_control_template_scripts()](https://developer.wordpress.org/reference/classes/wp_widget_media_image/render_control_template_scripts/)`wp-includes/widgets/class-wp-widget-media-image.php` |

Render form template scripts.

  | 
| [wp_print_community_events_markup()](https://developer.wordpress.org/reference/functions/wp_print_community_events_markup/)`wp-admin/includes/dashboard.php` |

Prints the markup for the Community Events section of the Events and News Dashboard widget.

  | 
| [WP_MS_Themes_List_Table::column_description()](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_description/)`wp-admin/includes/class-wp-ms-themes-list-table.php` |

Handles the description column output.

  | 
| [WP_Customize_Theme_Control::content_template()](https://developer.wordpress.org/reference/classes/wp_customize_theme_control/content_template/)`wp-includes/customize/class-wp-customize-theme-control.php` |

Render a JS template for theme display.

  | 
| [login_header()](https://developer.wordpress.org/reference/functions/login_header/)`wp-login.php` |

Outputs the login page header.

  | 
| [network_step1()](https://developer.wordpress.org/reference/functions/network_step1/)`wp-admin/includes/network.php` |

Prints step 1 for Network installation process.

  | 
| [network_step2()](https://developer.wordpress.org/reference/functions/network_step2/)`wp-admin/includes/network.php` |

Prints step 2 for Network installation process.

  | 
| [WP_Plugins_List_Table::single_row()](https://developer.wordpress.org/reference/classes/wp_plugins_list_table/single_row/)`wp-admin/includes/class-wp-plugins-list-table.php` |

Generates the markup for a single plugin row.

  | 
| [Bulk_Upgrader_Skin::after()](https://developer.wordpress.org/reference/classes/bulk_upgrader_skin/after/)`wp-admin/includes/class-bulk-upgrader-skin.php` |

Performs an action following a bulk update.

  | 
| [site_admin_notice()](https://developer.wordpress.org/reference/functions/site_admin_notice/)`wp-admin/includes/ms.php` |

Displays an admin notice to upgrade all sites after a core upgrade.

  | 
| [new_user_email_admin_notice()](https://developer.wordpress.org/reference/functions/new_user_email_admin_notice/)`wp-includes/user.php` |

Adds an admin notice alerting the user to check for confirmation request email after email address change.

  | 
| [maintenance_nag()](https://developer.wordpress.org/reference/functions/maintenance_nag/)`wp-admin/includes/update.php` |

Displays maintenance nag HTML message.

  | 
| [update_nag()](https://developer.wordpress.org/reference/functions/update_nag/)`wp-admin/includes/update.php` |

Returns core update notification message.

  | 
| [install_plugin_information()](https://developer.wordpress.org/reference/functions/install_plugin_information/)`wp-admin/includes/plugin-install.php` |

Displays plugin information in dialog box form.

  | 
| [wp_dashboard_quick_press()](https://developer.wordpress.org/reference/functions/wp_dashboard_quick_press/)`wp-admin/includes/dashboard.php` |

Displays the Quick Draft widget.

  | 
| [default_password_nag()](https://developer.wordpress.org/reference/functions/default_password_nag/)`wp-admin/includes/user.php` |  | 
| [WP_Plugin_Install_List_Table::display_rows()](https://developer.wordpress.org/reference/classes/wp_plugin_install_list_table/display_rows/)`wp-admin/includes/class-wp-plugin-install-list-table.php` |

Generates the list table rows.

  | 
| [WP_Plugin_Install_List_Table::no_items()](https://developer.wordpress.org/reference/classes/wp_plugin_install_list_table/no_items/)`wp-admin/includes/class-wp-plugin-install-list-table.php` |  | 
| [_local_storage_notice()](https://developer.wordpress.org/reference/functions/_local_storage_notice/)`wp-admin/includes/template.php` |

Outputs the HTML for restoring the post data from DOM storage

  | 
| [wp_comment_reply()](https://developer.wordpress.org/reference/functions/wp_comment_reply/)`wp-admin/includes/template.php` |

Outputs the in-line comment reply-to form in the Comments list table.

  | 
| [wp_import_upload_form()](https://developer.wordpress.org/reference/functions/wp_import_upload_form/)`wp-admin/includes/template.php` |

Outputs the form used by the importers to accept the data to be imported.

  | 
| [do_meta_boxes()](https://developer.wordpress.org/reference/functions/do_meta_boxes/)`wp-admin/includes/template.php` |

Meta-Box template function.

  | 
| [post_submit_meta_box()](https://developer.wordpress.org/reference/functions/post_submit_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays post submit form fields.

  | 
| [WP_Terms_List_Table::inline_edit()](https://developer.wordpress.org/reference/classes/wp_terms_list_table/inline_edit/)`wp-admin/includes/class-wp-terms-list-table.php` |

Outputs the hidden row displayed when inline editing

  | 
| [request_filesystem_credentials()](https://developer.wordpress.org/reference/functions/request_filesystem_credentials/)`wp-admin/includes/file.php` |

Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.

  | 
| [WP_Posts_List_Table::inline_edit()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/inline_edit/)`wp-admin/includes/class-wp-posts-list-table.php` |

Outputs the hidden row displayed when inline editing

  | 
| [Custom_Image_Header::step_1()](https://developer.wordpress.org/reference/classes/custom_image_header/step_1/)`wp-admin/includes/class-custom-image-header.php` |

Displays first step of custom header image page.

  | 
| [core_upgrade_preamble()](https://developer.wordpress.org/reference/functions/core_upgrade_preamble/)`wp-admin/update-core.php` |

Display upgrade WordPress for downloading latest or upgrading automatically form.

  | 
| [Custom_Background::admin_page()](https://developer.wordpress.org/reference/classes/custom_background/admin_page/)`wp-admin/includes/class-custom-background.php` |

Displays the custom background page.

  | 
| [WP_Widget_Text::form()](https://developer.wordpress.org/reference/classes/wp_widget_text/form/)`wp-includes/widgets/class-wp-widget-text.php` |

Outputs the Text widget settings form.

  | 
| [wp_print_media_templates()](https://developer.wordpress.org/reference/functions/wp_print_media_templates/)`wp-includes/media-template.php` |

Prints the templates used in the media manager.

  |

[Show 38 more](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.4.0](https://developer.wordpress.org/reference/since/6.4.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#comment-content-7056)
 2.    [dcoderoli](https://profiles.wordpress.org/dcoderoli/)  [  2 years ago  ](https://developer.wordpress.org/reference/functions/wp_admin_notice/#comment-7056)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%23comment-7056)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%23comment-7056)
 4.  In the plugin php file, using `wp_admin_notice()` throws an error, I just wrap
     it in the `add_action` hook
 5.      ```php
         add_action( 'admin_notices', function () {
         	wp_admin_notice(
         		__( 'Your success message here.', 'your-text-domain' ),
         		array(
         			'id'                 => 'message',
         			'additional_classes' => array( 'updated' ),
         			'dismissible'        => true,
         		)
         	);
         } );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%3Freplytocom%3D7056%23feedback-editor-7056)
 7.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/wp_admin_notice/?output_format=md#comment-content-6831)
 8.    [Baikare Sandip](https://profiles.wordpress.org/baikaresandeep007-1/)  [  3 years ago  ](https://developer.wordpress.org/reference/functions/wp_admin_notice/#comment-6831)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%23comment-6831)
     Vote results for this note: -1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%23comment-6831)
 10. With this method you can show the message in the WordPress admin.
 11.     ```php
         wp_admin_notice(
         	__( 'Your success message here.', 'your-text-domain' ),
         	array(
         		'id'                 => 'message',
         		'additional_classes' => array( 'updated' ),
         		'dismissible'        => true,
         	)
         );
         ```
     
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F%3Freplytocom%3D6831%23feedback-editor-6831)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_admin_notice%2F)
before being able to contribute a note or feedback.