Depending on time of the day and number of comments, using WordPress gravatars can cause a significant slow-down in your blog load time.
Last week, I noticed a significant slow-down in one of my blogs. Pages were taking about 8-10 seconds to load, when previously they would load almost instantaneously.
There are several ways to address this issue -
1. Turn-off Gravatars
How to turn off gravatars -
- Go to Settings >> Discussion.
- Scroll down to the bottom of the screen to the Avatar section.
- Under Avatar Display select Don’t Show Avatars.
However, turning off gravatars will make your WordPress blog comments section less personalized, and less visually compelling.
2. Set Number of Comments
Another way to deal with slow load-time is to reduce the number of comments shown on each page.
Again go to Settings >> Discussion. The last bullet under Other Comment Settings allows you to set the maximum number of comments shown on each page.
You can also set the order in which the comments are displayed, e.g. display newer or older comments first.
Limiting the number of comments per page, however, will make it less likely for users to read all the comments.
In addition, it may confuse search engines, causing you to lose the keyword value of your comments, or worse, result in duplicate content penalties.
3. Use Your Own Gravatars
Using local gravatar images lets you control the look of your blog, and removes the added time overhead of accessing the gravatar.com site.
To use local gravatar images, add the function below into your theme functions.php file.
function local_gravatar($comment, $dim) {
static $gravatar_img = NULL;
if (!strcmp($comment->comment_author, "YOUR_USER_ID"))
return "<img src='YOUR_IMAGE.JPG'" . "' width='" . $dim . "' height='" . $dim . "' />";
// Return a gravatar image based on IP
$img_num = intval($comment->comment_author_IP);
if (!$gravatar_img) {
$gravatar_img = get_gravatar_images();
if (!$gravatar_img) return NULL;
$gravatar_img = explode('|', $gravatar_img);
}
$img_count = count($gravatar_img);
$index = abs($img_num % $img_count);
// Construct new image http
$img_uri = "<img src='" . get_theme_mod('gravatar_dir') . $gravatar_img[$index] . "' width='" . $dim . "' height='" . $dim . "' />";
return $img_uri;
}
Lines 3-4 – Checks for your user-ID and returns a special predefined image.
Lines 7-19 – For all other users, we return a local gravatar image based on their IP. You can also return gravatar images based on e-mail or website.
To do this replace $comment->comment_author_IP on Line-7 with $comment->comment_author_email or $comment->comment_author_url.
Note – In Line-9 we call the get_gravatar_images function which retrieves an appropriate image from a list of images in your local blog directory.
Here is the source code for the get_gravatar_images function.
Below are a set of gravatar images I created for my Shiba WordPress theme. Feel free to use them as your initial example gravatar images.
This is an example WordPress blog page with over 100 comments, using the local_gravatar function above.
4. Use a Gravatar Cache Plugin
There are also a variety of plugin-ins that allow you to cache gravatar results locally so that your blog does not need to keep accessing the gravatar.com site.
Here is a list of other great WordPress optimization tips by Vladimir Prelovac.


















Shiba Skins WordPress Theme
How to Add the Media Manager Menu to the Theme Preview Interface
Debugging the w3tc Page Cache
How to Translate blogs.dir CDN Files in w3tc
How to Create Dynamic User Agent Groups in w3tc
How to Selectively Load Plugins for Specific Pages
WordPress Theme Customizer Javascript Interface
Mobile Responsive Galleries and Images
How to Add the WordPress 3.5 Media Manager Interface - Part 2
How to Add the WordPress 3.5 Media Manager Interface
Custom Post Type Permalinks – Part 2 (116)
Shiba Gallery 3.7 (28)
Add Tags and Categories to Your WordPress Page (46)
WordPress Media Library Plugin (242)
WordPress Example Plugin (7)
WordPress Search Widget – How to Style It (47)
WordPress Custom Taxonomy Input Panels (98)
Create Pop-up Windows in Your WordPress Blog with Thickbox (35)
You absolute moron. Gravatar.com is highly tuned to serve avatars and does a better job at it than most people’s piss-ant hosting can. Comment paging is the answer.
Perhaps you were too busy to read the article before leaving a comment. In the article I have a whole section on –
This article has page speed tests as well as a detailed explanation of gravatars and page speed.
http://www.seomofo.com/wordpress/comments-slow-page-speed.html
Here is an excerpt from the article -
This article on rude people may also be helpful.
http://shibashake.com/dog/rude-dogs-and-rude-people#rude-people