Title: wp_dashboard_browser_nag
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_dashboard_browser_nag()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/wp_dashboard_browser_nag/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_dashboard_browser_nag/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_dashboard_browser_nag/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_dashboard_browser_nag/?output_format=md#changelog)

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

Displays the browser update nag.

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

    ```php
    function wp_dashboard_browser_nag() {
    	global $is_IE;

    	$notice   = '';
    	$response = wp_check_browser_version();

    	if ( $response ) {
    		if ( $is_IE ) {
    			$msg = __( 'Internet Explorer does not give you the best WordPress experience. Switch to Microsoft Edge, or another more modern browser to get the most from your site.' );
    		} elseif ( $response['insecure'] ) {
    			$msg = sprintf(
    				/* translators: %s: Browser name and link. */
    				__( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
    				sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
    			);
    		} else {
    			$msg = sprintf(
    				/* translators: %s: Browser name and link. */
    				__( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
    				sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
    			);
    		}

    		$browser_nag_class = '';
    		if ( ! empty( $response['img_src'] ) ) {
    			$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];

    			$notice           .= '<div class="alignright browser-icon"><img src="' . esc_url( $img_src ) . '" alt="" /></div>';
    			$browser_nag_class = ' has-browser-icon';
    		}
    		$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";

    		$browsehappy = 'https://browsehappy.com/';
    		$locale      = get_user_locale();
    		if ( 'en_US' !== $locale ) {
    			$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
    		}

    		if ( $is_IE ) {
    			$msg_browsehappy = sprintf(
    				/* translators: %s: Browse Happy URL. */
    				__( 'Learn how to <a href="%s" class="update-browser-link">browse happy</a>' ),
    				esc_url( $browsehappy )
    			);
    		} else {
    			$msg_browsehappy = sprintf(
    				/* translators: 1: Browser update URL, 2: Browser name, 3: Browse Happy URL. */
    				__( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ),
    				esc_attr( $response['update_url'] ),
    				esc_html( $response['name'] ),
    				esc_url( $browsehappy )
    			);
    		}

    		$notice .= '<p>' . $msg_browsehappy . '</p>';
    		$notice .= '<p class="hide-if-no-js"><a href="" class="dismiss" aria-label="' . esc_attr__( 'Dismiss the browser warning panel' ) . '">' . __( 'Dismiss' ) . '</a></p>';
    		$notice .= '<div class="clear"></div>';
    	}

    	/**
    	 * Filters the notice output for the 'Browse Happy' nag meta box.
    	 *
    	 * @since 3.2.0
    	 *
    	 * @param string      $notice   The notice content.
    	 * @param array|false $response An array containing web browser information, or
    	 *                              false on failure. See wp_check_browser_version().
    	 */
    	echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/dashboard.php#L1712)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/dashboard.php#L1712-L1781)

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

 [apply_filters( ‘browse-happy-notice’, string $notice, array|false $response )](https://developer.wordpress.org/reference/hooks/browse-happy-notice/)

Filters the notice output for the ‘Browse Happy’ nag meta box.

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

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

Retrieves the locale of a user.

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

Checks if the user needs a browser update.

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

Retrieves the translation of $text and escapes it for safe use in an attribute.

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

Determines if SSL is used.

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

Retrieves the translation of $text.

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

Checks and cleans a URL.

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

Escaping for HTML blocks.

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

Escaping for HTML attributes.

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

Retrieves a modified URL query string.

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

Calls the callback functions that have been added to a filter hook.

  |

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

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

| Version | Description | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Added a special message for Internet Explorer users. | 
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Introduced. |

## User Contributed Notes

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