How To Add A Favicon To Your WordPress Site

Add Favicon To WordPressAll WordPress blogs should have favicons (the little icon that displays to the left of the website address in your browser screen). The default WordPress favicon just smacks of amateurism. And you’re not an amateur, right?

Fortunately, installing a favicon on your WordPress site is a piece of cake. And although there are plugins available that can do it for you, such a task definitely falls into the “you do absolutely not need to use a plugin to do this” category. After all, you want to keep your site lean and mean.

First of all, you will need a favicon. My site of choice is Favicon Generator and Gallery, where you can convert your own image files into favicons, or just select from their gallery. Once you have your favicon ready, upload it to your WordPress site via the Media Library and copy the image’s URL.

Next, add this simple code to your theme’s functions.php file:

function my_favicon() { ?>
<link rel="shortcut icon" href="yourimagepathgoeshere" >
<?php }
add_action('wp_head', 'my_favicon');

That’s it! The above function will place the link to your favicon in the appropriate place (i.e. between the <head></head> tags).

Creative Commons photo courtesy of ulterior epicure