• I’m trying to find a way to completely disable any calls to gravatar.com.

    I have disabled avatars in Settings>Discussion, but when I load a page, I can see in my browser’s status bar that it still loads 0.gravatar.com even though it shouldn’t have any need to. On certain occasions, this causes page load to hang for several seconds before content starts loading.

    This website has zero comments and I don’t anticipate many comments in the future, so it is not a useful feature from this site and I would rather have quick load speed than any kind of avatar support.

    Is there a way to completely remove it from WP? I’ve searched for a solution and found a plugin that calls local avatars (I don’t want ANY avatars) and some code to add to the functions.php file to disable gravatar.com (does not work).

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey atlcr,

    did you ever find a solution to this. If not, I believe that you can contact your hosting company, and tell them that you have URL’s that you want to set up from never loading on your site. Do that and please let me know how that goes.

    Good Luck! And Happy Holidays!

    Thread Starter atlcr

    (@atlcr)

    Thanks for your response! 🙂

    I’m not sure that would help though. WP would still send the request, it would just get blocked. Whether this would cause even more delays can’t be known until tried, but I just went through my control panel settings and there is no option for blocking certain sites (I’m on shared hosting with funio.com).

    My guess is that my hosting company will not help with anything outside of helping me with what can be done in the control panel (they use a CPanel alternative called Panel Box).

    Ideally, turning off any WP requests for Gravatar.com should be easy to disable. Disabling avatars entirely in settings still results in requests to gravatar.com (I have no idea why). I’m going to search through the WP core files (functions.php, etc.) to see if the gravatar support is hard-coded. I’ll post back here with results.

    Thread Starter atlcr

    (@atlcr)

    Actually, I just looked again and found an IP Deny option in my hosting. I added gravatar.com. Time to test it out…

    Let me know how it goes? Make sure you clear your cookies, caches, temp internet files, and do a cntrl F5, etc…. sometimes it will remain lurking in their. So if anything, also clean with ccleaner — and retest everything.

    Let me know?

    Thread Starter atlcr

    (@atlcr)

    It seems like it worked!

    I only wish that WP had an option to disable this entirely. Maybe one of the developers will read this and it will click.

    Just out of curiosity, I did a search on my files for “gravatar” and it came up with:

    \wp-admin\credits.php
        113: $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
        149: echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
    \wp-admin\options-discussion.php
        175: <?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>
        220: 'gravatar_default' => __('Gravatar Logo'),
    \wp-content\plugins\jetpack-lite\modules\widgets\top-posts.php
        137: 'gravatar_default' => apply_filters( 'jetpack_static_url', is_ssl() ? 'https' : 'http' . '://en.wordpress.com/i/logo/white-gray-80.png' ),
        181: if ( 'blavatar' != $image['from'] && 'gravatar' != $image['from'] ) {
    \wp-content\plugins\jetpack-lite\class.jetpack.php
        278: * This improves the resolution of gravatars and wordpress.com uploads on hi-res and zoomed browsers.
    \wp-content\plugins\jetpack-lite\class.jetpack-post-images.php
        328: static function from_gravatar( $post_id, $size = 96, $default = false ) {
        360: 'from'       => 'gravatar',
        414: 'fallback_to_avatars' => false, // Optionally include Blavatar and Gravatar (in that order) in the image stack
        416: 'gravatar_default'    => false, // Default image to use if we end up with no Gravatar
        447: $media = self::from_gravatar( $post_id, $args['avatar_size'], $args['gravatar_default'] );
    \wp-includes\pluggable.php
       1718: $host = 'https://secure.gravatar.com';
       1721: $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash[0] ) % 2 ) );
       1723: $host = 'http://0.gravatar.com';
       1727: $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
       1730: elseif ( !empty($email) && 'gravatar_default' == $default )
       1732: elseif ( 'gravatar_default' == $default )
    \wp-includes\post-template.php
       1357: * @return string gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.
       1370: $gravatar = get_avatar( $revision->post_author, 24 );
       1379: $gravatar,

    Just an FYI if want to find it in the code.

    Thread Starter atlcr

    (@atlcr)

    Thank you Mark! You are a gentleman and a scholar.

    I also have jetpack plugin installed, and seeing it show up in the jetpack folder with your search makes me think that jetpack might be the culprit.

    It’s just a shame that disabling gravatar via the settings menu does not disable it globally. Based on your search, I would need to edit several files to erase its existence. Btw, what program did you use to do the search?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘0.gravatar.com slowing down site’ is closed to new replies.