Title: Redirect Gravatar requests
Author: Bart Kuijper
Published: <strong>21. Februar 2019</strong>
Last modified: 24. Mai 2022

---

Search plugins

![](https://ps.w.org/redirect-gravatar-requests/assets/banner-772x250.png?rev=2035574)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/redirect-gravatar-requests/assets/icon-256x256.png?rev=2035574)

# Redirect Gravatar requests

 By [Bart Kuijper](https://profiles.wordpress.org/spartelfant/)

[Download](https://downloads.wordpress.org/plugin/redirect-gravatar-requests.2.0.0.zip)

 * [Details](https://de-ch.wordpress.org/plugins/redirect-gravatar-requests/#description)
 * [Reviews](https://de-ch.wordpress.org/plugins/redirect-gravatar-requests/#reviews)
 *  [Installation](https://de-ch.wordpress.org/plugins/redirect-gravatar-requests/#installation)
 * [Development](https://de-ch.wordpress.org/plugins/redirect-gravatar-requests/#developers)

 [Support](https://wordpress.org/support/plugin/redirect-gravatar-requests/)

## Description

When displaying a post or comment with avatars enabled, WordPress will always check
for the existence of a Gravatar. (Note: even the default avatars ‚mystery person‘
and ‚blank‘ are in fact Gravatars served from gravatar.com.) WordPress does this
by sending an MD5 hash of every displayed post or comment author’s email address
to gravatar.com. Even with many plugins that introduce locally stored default or
user avatars, this check still happens. On top of that, some themes or plugins force(
Gr)avatars to load even if the display of avatars is disabled completely in WordPress‘
settings. If for whatever reason you do not wish for Gravatar to receive these requests(
which some people have voiced GDPR concerns about), this plugin is for you.

The way it works is every time WordPress attempts to display an avatar, this plugin
first checks if the image is about to be retrieved from gravatar.com. If it is, 
the URL is changed to the locally stored ‚mystery person‘ image (included with this
plugin). If the avatar has any other source, this plugin doesn’t interfere.

Gravatars are also removed from the Discussion page in Settings and replaced with
the locally stored ‚mystery person‘ image. Again, any non-Gravatar images are left
alone.

Upon activation of this plugin, if a Gravatar is selected as the default avatar,
that setting is changed to the locally stored ‚mystery person‘ image. If any non-
Gravatar avatar is selected, that setting isn’t changed.

Upon deactivation of this plugin, if the locally stored ‚mystery person‘ image is
selected as the default avatar, that setting is changed to the Gravatar logo. If
any non-Gravatar avatar is selected, that setting isn’t changed.

## Screenshots

[⌊Plugin deactivated, Gravatars are loaded.⌉⌊Plugin deactivated, Gravatars are loaded
.⌉[

Plugin deactivated, Gravatars are loaded.

[⌊Plugin activated, Gravatars are redirected to the locally stored image.⌉⌊Plugin
activated, Gravatars are redirected to the locally stored image.⌉[

Plugin activated, Gravatars are redirected to the locally stored image.

[⌊Plugin deactivated, Gravatars are loaded.⌉⌊Plugin deactivated, Gravatars are loaded
.⌉[

Plugin deactivated, Gravatars are loaded.

[⌊Plugin activated, Gravatars are redirected to the locally stored image.⌉⌊Plugin
activated, Gravatars are redirected to the locally stored image.⌉[

Plugin activated, Gravatars are redirected to the locally stored image.

## Installation

This plugin can be installed the usual way through WordPress’s interface. If you
want to manually install this plugin:

 1. Upload the plugin files to `/wp-content/plugins/redirect-gravatar-requests/`.
 2. Activate the plugin through the ‚Plugins‘ menu in WordPress.

That’s it. You can (de)activate the plugin as often as you like. You can remove 
it completely either by deleting it in WordPress or through FTP. This plugin doesn’t
modify any files nor does it add anything new to the database, once removed there
is no trace of it.

## FAQ

### Can I change the local image?

Not through the WordPress Dashboard. You would have to replace `/wp-content/plugins/
redirect-gravatar-requests/mystery.jpg`. You would also have to repeat this after
each plugin update.

The reason for this choice is simple: if you enable the display of avatars, but 
use this plugin to block Gravatars, then you most likely are already using another
plugin for custom avatars.

### How to configure this plugin?

There is nothing to be configured about this plugin. As soon as it’s activated, 
it will redirect all attempts to load a Gravatar from gravatar.com to the locally
stored ‚mystery person‘ image included with this plugin.

You can verify that the plugin is working on a page displaying (Gr)avatars in Chrome
by opening the developer console (default hotkey F12), selecting the ‚Network‘ tab
at the top, typing ‚gravatar‘ in the console’s search box and then reloading the
page (by pressing CTRL+R). With the plugin deactivated, you will see requests going
out to gravatar.com. With the plugin activated, you will see those requests going
to this plugin’s locally stored image instead.

### Gravatars are still showing when using a particular theme or plugin, why?

This plugin filters the WordPress `get_avatar` function. However some theme and 
plugin authors use their own code to load (Gr)avatars, in some cases even if the
display of avatars is disabled completely in WordPress‘ settings. In order for this
plugin to be able to intercept Gravatars, the offending theme or plugin has to either
be making use of the `get_avatar` function or at least apply the `get_avatar` filter
in their code.

If you come across such a theme or plugin, feel free to open a [support ticket](https://wordpress.org/support/plugin/redirect-gravatar-requests/)
and I’ll be happy to see if there’s a way to deal with it.

### Is this plugin compatible with plugins that add other avatars?

It should be, since this plugin specifically targets only Gravatars. If you do run
into problems, please let me know.

## Reviews

![](https://secure.gravatar.com/avatar/9f5b870ec9dfd7c2760f5bb49511bb68b4aa6fe29f58d56387ba1d8e78edea59?
s=60&d=retro&r=g)

### 󠀁[Simple, effective, working!](https://wordpress.org/support/topic/simple-effective-working-2/)󠁿

 [salvia49](https://profiles.wordpress.org/salvia49/) 25. Dezember 2021

Works just fine with my WordPress v5.8.2. I use also the Gravatar features from 
GeoDirectory, WCMarketplace, UsersWP, and a few other plugins that use Gravatar 
functionality, and nothing to report everything works fine. I wish I could have 
used a .svg file rather than a .jpg file but never mind, I would be happy with it.

 [ Read all 1 review ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/)

## Contributors & Developers

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

Contributors

 *   [ Bart Kuijper ](https://profiles.wordpress.org/spartelfant/)

“Redirect Gravatar requests” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/redirect-gravatar-requests/contributors)
for their contributions.

[Translate “Redirect Gravatar requests” into your language.](https://translate.wordpress.org/projects/wp-plugins/redirect-gravatar-requests)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/redirect-gravatar-requests/),
check out the [SVN repository](https://plugins.svn.wordpress.org/redirect-gravatar-requests/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/redirect-gravatar-requests/)
by [RSS](https://plugins.trac.wordpress.org/log/redirect-gravatar-requests/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.0.0

 * Changed filter from `get_avatar_url` to `get_avatar` to also intercept Gravatars
   that were forcefully displayed by an unruly plugin.
 * All code refactored.
 * Tested on WordPress version 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, and 6.0.

#### 1.0.8

 * Fixed a bug where the plugin would generate an error instead of dying when directly
   accessed.

#### 1.0.7

 * Tested on WordPress version 5.3.

#### 1.0.6

 * Tested on WordPress version 5.2.
 * Increased required PHP version to 5.6.20 in line with the minimum required version
   for WP 5.2.

#### 1.0.5

 * Added translation to Dutch (nl_NL).
 * Fixed untranslatable string.
 * Reincluded translation template (`/languages/redirect-gravatar-requests.pot`).
 * Some minor touch-ups on the readme.txt.

#### 1.0.4

 * Refactored code to conform to WordPress coding standards.
 * Added FAQ link to plugin page.

#### 1.0.3

 * Added support and review links to plugin page.

#### 1.0.2

 * Tested on WordPress version 5.1.
 * Increased required PHP version to 5.6 in line with the minimum required version
   for WP 5.1.

#### 1.0.1

 * Some corrections to the readme.txt to make it more consistent.
 * Removed translation template (`/languages/redirect-gravatar-requests.pot`), because
   it’s ignored and a new one is automatically generatad.

#### 1.0.0

 * Initial release.

## Meta

 *  Version **2.0.0**
 *  Last updated **4 Jahren ago**
 *  Active installations **100+**
 *  WordPress version ** 4.6 or higher **
 *  Tested up to **6.0.18**
 *  PHP version ** 5.6.20 or higher **
 *  Languages
 * [Dutch](https://nl.wordpress.org/plugins/redirect-gravatar-requests/) und [English (US)](https://wordpress.org/plugins/redirect-gravatar-requests/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/redirect-gravatar-requests)
 * Tags
 * [avatar](https://de-ch.wordpress.org/plugins/tags/avatar/)[block](https://de-ch.wordpress.org/plugins/tags/block/)
   [disable](https://de-ch.wordpress.org/plugins/tags/disable/)[gravatar](https://de-ch.wordpress.org/plugins/tags/gravatar/)
   [redirect](https://de-ch.wordpress.org/plugins/tags/redirect/)
 *  [Advanced View](https://de-ch.wordpress.org/plugins/redirect-gravatar-requests/advanced/)

## Ratings

 5 von 5 Sternen.

 *  [  1 5-Sterne-Rezension     ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/?filter=5)
 *  [  0 4-Sterne-Rezensionen     ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/?filter=4)
 *  [  0 3-Sterne-Rezensionen     ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/?filter=3)
 *  [  0 2-Sterne-Rezensionen     ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/?filter=2)
 *  [  0 1-Sterne-Rezensionen     ](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/redirect-gravatar-requests/reviews/)

## Contributors

 *   [ Bart Kuijper ](https://profiles.wordpress.org/spartelfant/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/redirect-gravatar-requests/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://paypal.me/bartkuijper)