wp_favicon_request()

In this article

This function has been deprecated. Deprecated in favor of do_favicon() instead.

Ensures all of WordPress is not loaded when handling a favicon.ico request.

Description

Instead, send the headers for a zero-length favicon and bail.

Source

function wp_favicon_request() {
	if ( '/favicon.ico' === $_SERVER['REQUEST_URI'] ) {
		header( 'Content-Type: image/vnd.microsoft.icon' );
		exit;
	}
}

Changelog

VersionDescription
5.4.0Deprecated in favor of do_favicon() .
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.