Title: wp_favicon_request
Published: April 25, 2014
Last modified: May 20, 2026

---

# wp_favicon_request()

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_favicon_request/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/functions/wp_favicon_request/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_favicon_request/?output_format=md#changelog)

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

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

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

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_favicon_request/?output_format=md#description)󠁿

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

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

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

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

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

| Version | Description | 
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Deprecated. Deprecated in favor of [do_favicon()](https://developer.wordpress.org/reference/functions/do_favicon/) . | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

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