FV Gravatar Cache


There’s one problem with Gravatars. They are very slow to load. Each page with comments on them makes one call per comment to the Gravatar server. While a single call takes only a 100ms, on a page with hundreds of comments, we are talking about major slowdowns. Page loads can take 20 seconds and more.

This plugin solves this problem by:

  • caching gravatars with WordPress cron job..

  • caching gravatars on comment submission

  • maintaining a single copy of the default gravatar instead of downloading it again and again for all the email addresses with no gravatar associtated

Installation guide

Support and more information


  • FV Gravatar Cache screen


You can use the built in installer and upgrader, or you can install the plugin

After installing, make sure you visit the plugin settings to make sure the plugin works correctly. You will see a check if the cache directory is writable and you will have to set the gravatar size (plugin also uses autodetection mechanism, which might come handy).


Gravatars are not caching properly

Hit the “Empty Cache” button to clear the cache database and clear out the cache directory by hand (you can see the path at the very top of the Settings screen). Then hit the “Run Cron Now” button, it will refresh a couple of gravatars, so you can check the cache directory again, to see if it’s filling up correctly. “Current Cron offset:” will increment, so you can track the progess and see how the cron is running. You can also turn on “Debug mode” and check log.txt afterwards.

Generated (Itenticon, Wavatar and MonsterID) gravatars are not working correctly!

These types of gravatars are not currently supported. Drop us a note and we might add this feature in next release.

I want to have bigger gravatars on author profile pages. Your plugin supports only one gravatar size. Is there any workaround?

You can turn edit your template to turn off the FV Gravatar Cache just when needed, add this code right before that section in your WordPress template php file:

<?php global $FV_Gravatar_Cache; remove_filter( ‘get_avatar’, array( &$FV_Gravatar_Cache, ‘GetAvatar’ ) ); ?>

In case you need the FV Gravatar Cache running later in the template, just bring it back with:

<?php global $FV_Gravatar_Cache; add_filter( ‘get_avatar’, array( &$FV_Gravatar_Cache, ‘GetAvatar’ ) ); ?>

I don’t see the default gravatar on my options page!

If you selected empty gravatar in wp-admin -> Settings -> Discussion, then it’s ok. Otherwise try to resave the options and it should appear.


February 8, 2020
Nothing cached according to GTMetrix. The plugin settings page "cache information" shows 19 email addresses as the cached objects. The plug created six random user profile PNG files here, did not create cached versions of default Gravatar icons: /wp-content/uploads/fv-gravatar-cache Hmmm....
March 22, 2019
I installed this plugin on 3 blogs with three different hosts, and three different themes. It has the exact same problem on all three sites: it only caches about 3-10% of the Gravatars. Posted in their support forum but they responded (politely, to their credit) that they would only look into it if I paid them...even though it's clearly an issue with their plugin.
August 15, 2017
Been using this plugin for several years now. It just sits in the background doing what it does, year after year. Trouble-free and reliable.
September 3, 2016
This plugin works well and increases speed but the problem is it only caches images for the registered users. I want to cache for every user who comments on my page. (They Don't need to login to comment on my website instead giving their name and email id is enough)
September 3, 2016
Not sure if it's working, the settings are showing no gravatar's in cache.
Read all 10 reviews

Contributors & Developers

“FV Gravatar Cache” is open source software. The following people have contributed to this plugin.


Translate “FV Gravatar Cache” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Fix for PHP timeout when Gravatar server unreachable during comment posting
  • WordPress 5.4 compatibility checked


  • Security fixes
  • WordPress 5.3 compatibility checked


  • Fix for WP Rocket CDN rewrite


  • Fixing PHP notices


  • added retina alternative for default gravatar
  • fixed retina images srcset
  • retina images downloading enabled by default now


  • changed images directory to wp-content/uploads/fv-gravatar-cache/
  • added support for retina images
  • added cache purge after update if cache directory is set to default
  • added protocol independent urls
  • added paging for gravatars into settings screen
  • fixed cron offset reset
  • fixed perfomance issues
  • fixed PHP warning
  • fixed security issue for debug log functionality
  • fixed images – adding .png extension as default


  • fix for PHP warnings by Thomas van der Westen


  • Added admin_notice warnings
  • Added a check if the cache directory is empty when the cached data is present in database – to prevent 404 errors for cache gravatars
  • Improving conditions, improving checking of values after submit


  • Fix for PHP warnings
  • Fix for cache disappearing after plugin upgrade (applies to users who didn’t changed the cache directory)


  • Cron job limited to 2 seconds execution time


  • Bugfix for empty gravatar in cache


  • Bug fix for WordPress 3.1 admin bar
  • Bug fix for blank gravatar


  • Better detection of missing/default gravatars


  • First public release


  • Added cron support


  • Works only for logged in users