Title: is_favicon
Published: April 1, 2020
Last modified: May 20, 2026

---

# is_favicon(): bool

## In this article

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

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

Is the query for the favicon.ico file?

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_favicon/?output_format=md#return)󠁿

 bool Whether the query is for the favicon.ico file.

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

    ```php
    function is_favicon() {
    	global $wp_query;

    	if ( ! isset( $wp_query ) ) {
    		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
    		return false;
    	}

    	return $wp_query->is_favicon();
    }
    ```

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

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

| Uses | Description | 
| [WP_Query::is_favicon()](https://developer.wordpress.org/reference/classes/wp_query/is_favicon/)`wp-includes/class-wp-query.php` |

Determines whether the query is for the favicon.ico file.

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

Retrieves the translation of $text.

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

Marks something as being incorrectly called.

  |

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

| Used by | Description | 
| [WP::handle_404()](https://developer.wordpress.org/reference/classes/wp/handle_404/)`wp-includes/class-wp.php` |

Set the Headers for 404, if nothing is found for requested URL.

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

Redirects incoming links to the proper URL based on the site url.

  |

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

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

## User Contributed Notes

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