Stop WordPress Serving Its Logo as favicon.ico
When no Site Icon is set, WordPress answers /favicon.ico with its own logo. This returns a plain 404 instead, so your tab never shows the WordPress logo.
Opens WPIDE on
Code
add_action( 'do_faviconico', function () {
if ( ! has_site_icon() ) {
status_header( 404 );
nocache_headers();
exit;
}
}, 1 );
Notes
If a real favicon.ico file exists in the site root, your web server serves it before WordPress is involved.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.