How To Add A Favicon To WordPress Admin & Login Page

Favicon is nothing but a site identity. In this article, we show you how to add a favicon to WordPress admin and login pages.

Normally, we show our site favicon on the front-end. Our users always visit the front-end of our website. No users actually interested in the admin area. But again, Favicon is nothing but the site identity. You may want to add a favicon in the back-end area also.

Add Favicon To WordPress Admin & Login Page

We use two hooks login_head, admin_head to add favicon to WordPress admin and login page respectively. These hooks add the code written in the callback function to the head section of the respective pages. Make sure you have kept your favicon in your active theme directory. Place the below code in the theme’s functions.php file.

function add_site_favicon() {
	echo '<link rel="shortcut icon" 
href="' . get_stylesheet_directory_uri() . '/favicon.ico" />';
}
  
add_action('login_head', 'add_site_favicon');
add_action('admin_head', 'add_site_favicon');

That’s it! I hope you are now able to add a favicon to WordPress admin & login page. For any questions or suggestions please leave a comment below.

If you liked this article, then please subscribe to our YouTube Channel for video tutorials.

1 thought on “How To Add A Favicon To WordPress Admin & Login Page

Leave a Reply

Your email address will not be published.