Use Gravatar image as WordPress favicon

Gravatar stands for Globally Recognized Avatar. It is globally recognized because millions of people and websites use them. To know more about Gravatar, you can visit

To use Gravatar image as favicon on your WordPress site, add the following code in your theme’s functions.php file..

// Add the following code in theme's functions.php file to use Gravatar image as favicon (16×16 favicon.ico)
function dcg_gravatar_favicon() {
// Replace email here
$GetEmailHash = md5(strtolower(trim('')));
<link rel="shortcut icon" href="<?php echo '' . $GetEmailHash . '?s=16;'; ?>" type="image/x-icon" />
add_action('wp_head', 'dcg_gravatar_favicon');

view raw
hosted with ❤ by GitHub