Avatar Privacy


Avatare von Gravatar.com sind großartig, aber sie haben einige Auswirkungen auf die Privatsphäre. Als Site-Administrator weißt du das vielleicht schon, aber deine Besucher und Benutzer wahrscheinlich nicht. Avatar Privacy kann helfen, die Datenschutzsituation zu verbessern, indem es einige kleine Änderungen an der Art und Weise vornimmt, wie Avatare auf deiner Website angezeigt werden.

Das Plugin funktioniert ohne Änderung der Theme-Dateien, wenn ein modernes Theme verwendet wird, und es unterstützt Multisite-Installationen. Damit das Plugin seine Arbeit machen kann, musst du die Seite mit den Diskussionseinstellungen im WordPress-Admin-Bereich aufrufen und die neuen Einstellungen speichern. Bitte beachte, dass das Plugin keine eigene Optionsseite zur Verfügung stellt, sondern die bestehende Seite der Diskussionseinstellungen ergänzt.


The plugin’s features summed up:

  • Self-uploaded avatars for users (and custom default images), hosted on your server.
  • Users and commenters explicitly opt-in before using gravatars.
  • Gravatar caching to ensure the privacy of your website visitors.
  • Don’t publish weakly encrypted e-mail addresses of comment authors.

A more detailed examination of the reasons for using Avatar Privacy can be found on the plugin homepage.


Please report any problems with the plugin, I’ll do my best to sort things out. You can use the contact form on my code site or create a topic in the support forum. You can contact me in German or English.


Avatar Privacy is based on the original plugin by Johannes Freudendahl. The new release also includes work by several other people:



Avatar Privacy has the following additional requirements beyond those of WordPress itself:
* Your server must run PHP 5.6.0 or later, and
* the PHP installation must include the GD extension (most do).


I activated the plugin and don’t see any change!?

Did you remember to visit the discussion settings page, activate ‚Show Avatars‘? You have to enable avatars for this plugin to be able to do anything.

I saved the settings and still don’t see any changes. How do I know the plugin works?

Depending on which options you selected, you might not see a change in the way the page looks. The changes are visible in the source code though:

  • Look at the gravatar image URL of a user without a gravatar. The plugin works if the URL looks like [your site]/wp-content/uploads/avatar-privacy/cache/gravatars/[x]/[y]/[long SHA256 token]-68.png instead of https://secure.gravatar.com/avatar/[other long MD5 token]?s=68&d=http%3A%2F%2F1.gravatar.com%2Favatar%2F[long MD5 token]%3Fs%3D68&r=PG. There aren’t two URLs in there anymore, only one, and the default URL looks the same for two comments without a gravatar.
  • You should see the checkbox on the comment form. You need to log out though to see it. If you are logged in, you should see a similar checkbox in your user profile in the WordPress backend.
I still don’t see the checkbox in the comment form!? Everything else works.

Then you probably don’t use a modern theme which makes use of the function comment_form() to create the comment form. Check if you can find this function used in comments.php or a similar file of your theme. If you do and it still doesn’t work, tell me. Otherwise chances are that you do have to add the checkbox manually. Use this function:

<?php if (function_exists('avapr_get_avatar_checkbox')) echo avapr_get_avatar_checkbox(); ?>
What happens if I disable the plugin? Are any of the data altered?

The plugin saves additional data about whether commenters and users want to display a gravatar or not (if you select that mode in the settings). These data are deleted when you properly uninstall the plugin.

Apart from that, the plugin only filters data, but does not permanently change them. Especially, if you deactivate the plugin und have gravatars turned on, they will again show up for everybody, even those commenters and users who opted out of displaying gravatars. You do have to change the default gravatar back manually, though.

Can this plugin be used together with cache plugins?

Yes, it certainly can. You have to be careful though which plugin options you select and how you cache your content. The first plugin option checks if a gravatar exists for a given e-mail address and, if not, displays the default image directly. If you cache the output of this check, the gravatar will not be displayed if the user later decides to sign up with Gravatar.com. If you’re using this option, you should invalidate cached pages with gravatars on them (mostly the single view of entries) regularly.

Can this plugin be used on a multisite installation?

Yes, the plugin can be used on a multisite installation. You can either activate it on individual blogs or do a network activation. As users are global to a multisite installation, their choice regarding Gravatar.com use will affect all sites in the network. So if a user comments on blog A and chooses to display gravatars, this decision will be followed on blog B and C too. On new installations, comment author (i.e. non-user) opt-in is recorded per site, not per network. If you first installed Avatar Privacy 0.4 or earlier, the global table wp_avatar_privacy continues to be used for all sites in the multisite network. This behavior can be overriden by the network admin via the filter hook avatar_privacy_enable_global_table.

Won’t spam comments flood the database table with useless entries for the checkbox in the comment form?

The plugin doesn’t save the value of the „use gravatar“ checkbox for comments by registered users (see below), trackbacks/pingbacks (there is no e-mail address) and comments that are marked as spam when they are saved. If you mark a comment as spam later, the table entry is not removed, since the same e-mail address might also be used by non-spam comments. If a comment is marked as spam by Akismet or similar plugins and you later manually mark it as non-spam, what the user selected when submitting the comment will already be lost. This only happens with spam comments, not comments who just need to be moderated, e.g. because of the ’needs at least one published comment‘ rule.

Will the avatar caching make my disk space run out?

While storing the cached avatar images on your own server will take some extra disk space, the plugin makes sure that it does not grow out of bounds by deleting cached gravatars every other day and all other images once a week. When the cached file is accessed again, it is automatically regenerated.

If you don’t have to worry about the amount of disk space consumed, you can extend the maximum age of cached files via the filter hooks avatar_privacy_gravatars_max_age and avatar_privacy_all_images_max_age. The cron job intervals can also be adjusted via hooks (avatar_privacy_gravatars_cleanup_interval and avatar_privacy_all_images_cleanup_interval, respectively).

Can commenters override a registered user’s choice whether to display a gravatar by creating fake comments?

No, for registered users the user profile is checked, not the table for the commenter’s choices. Commenters can not override this value, not even the user themselves if they post a comment when not signed-in.

Which plugins are known to work with Avatar Privacy?

I used Avatar Privacy together with these plugins:

If you find any problems with particular plugins, please tell me!

What happens if I remove the plugin?

There is a difference between deactivating the plugin and uninstalling it. The plugin gets deactivated if you do so on the plugins page or if you simply delete the plugin files via FTP. No uninstallation tasks are performed then, so you can activate and deactivate the plugin as you want without losing the plugin’s settings.

If you deactivate the plugin und have gravatars turned on, they will again show up for everybody, even those commenters and users who opted out of displaying gravatars. If you changed the default avatar to one of the new local avatar images, the gravatars will not be displayed until you change the default avatar image back.

OK, but I really want to get rid of everything. How do I that?

If you want to completely uninstall the plugin and get rid of any data in the database, you should properly uninstall it: Deactivate the plugin first via the WordPress plugins page and then click ‚delete‘ (same page, next to the plugin). For multisite installations, this has to be done by the network administrator on the network plugins page.

The plugin saves additional data about whether commenters and users want to display a gravatar or not (if you select that mode in the settings). The following data are stored by the plugin and deleted upon uninstallation:

  • custom table(s) [prefix]_avatar_privacy (global or per blog on new multisite installations)
  • usermeta values per user: use_gravatar, avatar_privacy_hash, avatar_privacy_user_avatar
  • option per blog: avatar_privacy_settings
  • option per network (sitemeta) on multisite installations: avatar_privacy_salt
  • transient per commenter: avapr_check_[mail hash]

The default avatar image is set to the mystery man if you selected one of the new local default avatar images.


18. Juli 2019
This plugin makes it possible to use Gravatars without compromising privacy ("Datenschutz" in German). Thanx for the plugin and I agree with other reviewers: This functionality should be in core. --- One suggestion: add an (unbreakable) space in the comment form option between the checkbox and the label. It's in avatar-privacy/public/partials/comments/use-gravatar.php, line 60. I have added it, but will lose it again after the next plugin update 😉
10. Juli 2019
Thank you very much for this plugin. There is no extra dashboard in WP necessary. It´s only extending the setting-area of your user and the discussion-settings. So you can make your comments with a view klicks agreeing to the DSGVO. It run´s very well on my studiopress-theme.
9. Juni 2019
Excellent plugin with pro support! Had a rather tricky issue on Windows -- which the developer doesn't use -- and he went the extra mile to comprehend, install a Windows VM to debug, and finally fix. From all the features, I like the cache thing that keeps the varied collections of avatars offered by the plugin saved locally, avoiding that way the constant hitting of outside services that may slowdown page loading overall.
16. August 2018
UPDATE: Dev replied quickly and helped with "workaround fix". Looks like the site that was affected was still running PHP 5.6 which is not like me as i like to keep that up to date 😛 Updating to PHP 7.2 should fix the PARSE Error Issue, if you get one. --- The newest update of this plugin seems to break multisite websites. Please look into that. And yes I am sure it's your plugin. I get an error message accessing the website after updating Avatar Privacy which leads to its directory. Sorry, have no time to replicate error to copy paste the exact error message here. Need the site to be online so not updating for now.
Lies alle 13 Rezensionen

Mitwirkende & Entwickler

„Avatar Privacy“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:


„Avatar Privacy“ wurde in 3 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.

Übersetze „Avatar Privacy“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.


2.2.2 (2019-06-23)

  • Bugfix: Re-allow installation on 4.9.x for increased compatibility with possible future WordPress Core changes. The 2.2.x branch of Avatar Privacy is the last that will support WordPress < 5.2.

2.2.1 (2019-06-08)

  • Bugfix: Compatibility with Windows servers.

2.2.0 (2019-05-12)

2.1.0 (2019-04-14)

  • Feature: Improved compatibility with multisite installations. Plugin data will be properly deleted on uninstallation or when a site is removed. („Large Networks“ will still have to take manual action to prevent timeouts.)
  • Feature: Network settings for enabling/disabling global table use on multisite. Existing global data will be migrated to the site-specific tables when global table use is disabled (but not in the other direction).
  • Change: usermeta keys are now prefixed (avatar_privacy_use_gravatar instead of use_gravatar).
  • Change: Generally improved code quality through unit tests.
  • Bugfix: New multisite installations were incorrectly detected as „legacy“, making them use the global table (instead of per-site tables). Affected installations can be switched via the new network settings page.

2.0.5 (2019-02-23)

  • Bugfix: Fixed a previously undiscovered compatibility issue with recent versions of EWWW Image Optimizer.

2.0.4 (2019-02-22)

  • Bugfix: Updated included libraries for improved compatibility with other plugins.

2.0.3 (2018-11-30)

  • Bugfix: Prevent warnings when trying to retrieve the avatar for an invalid user ID.

2.0.2 (2018-09-09)

  • Bugfix: Updated included libraries for improved compatibility with other plugins.

2.0.1 (2018-08-16)

  • Bugfix: The plugin no longer fails with a fatal error on PHP 5.6 (accidentally introduced in 2.0.0).

2.0.0 (2018-08-11)

  • Feature: Administrators can now upload site-specific default avatar images.
  • Feature: The default policy previously only accessible via the avatar_privacy_gravatar_use_default hook can now be set from the Discussion settings page.
  • Feature: New filter hooks avatar_privacy_gravatar_link_rel and avatar_privacy_gravatar_link_target to filter the rel and target attributes of all links to Gravatar.com.
  • Bugfix: The REST API returned incorrect avatar URLs for registered users (workaround for trac ticket #40030).
  • Bugfix: The gravatar use cookie is only set when the comment author has given consent.
  • Change: Internal restructuring to make maintenance easier.

1.1.1 (2018-06-11)

  • Bugfix: Changing the default gravatar policy via avatar_privacy_gravatar_use_default works again for registered users.

1.1.0 (2018-06-10)

  • Feature: Supports the new privacy tools on WordPress >= 4.9.6 (export and deletion of personal data, suggested privacy notice text).
  • Feature: Registered users can opt into allowing logged-out comments with the same mail address to user their profile pictures.
  • Feature: The plugin is now compatible with bbPress.
  • Feature: The position of the use_gravatar checkbox can be adjusted via the new filter hook avatar_privacy_use_gravatar_position.
  • Change: Trashed comments and comments marked as spam do not trigger a validation request to Gravatar.com if the admin has set the default gravatar use policy to „enabled“ via the filter hook avatar_privacy_gravatar_use_default.

1.0.7 (2018-06-06)

  • Bugfix: The use_gravatar is actually checked when the cookie has been set.
  • Bugfix: A (harmless) PHP warning has been fixed.

1.0.6 (2018-05-29)

  • Bugfix: Only valid response codes from Gravatar.com are cached (200 and 404).
  • Bugfix: Plugin transients are cleared on plugin upgrades.
  • Bugfix: The workaround for trac ticket #42663 introduced in 1.0.5 is expanded to all uses of wp_get_image_editor().

1.0.5 (2018-05-22)

  • Bugfix: Prefer GD-based implementations of WP_Image_Editor to work around trac ticket #42663.
  • Bugfix: The rel and target attributes are allowed in use_gravatar checkbox labels and by the default, the noopener and nofollow values for the rel attribute are added to the Gravatar.com link.
  • Bugfix: Invalid 0-byte image files are not saved anymore.

1.0.4 (2018-05-20)

  • Bugfix: When the plugin is uninstalled, the default avatar image is really reset to mystery if necessary.
  • Bugfix: The use_gravatar checkbox is compatible with more themes now.

1.0.3 (2018-05-17)

  • Bugfix: The plugin no longer fails with a fatal error on PHP 5.6.

1.0.2 (2018-05-16)

  • Bugfix: PNG avatars were not created correctly when EWWW Image Optimizer was enabled.

1.0.1 (2018-05-14)

  • Bugfix: Non-multisite installations triggered an SQL error in some situations.

1.0 (2018-05-13)

  • Feature: All default avatars are generated on your server.
  • Feature: Gravatar.com avatars are cached locally. (The cache is cleaned regularly via a cron job to prevent unlimited growth.)
  • Feature: Registered users can upload their own avatar images to your server.
  • Change: Refactored according to modern development principles.
  • Change: Removed settings in favor of sensible default values and filter hooks:
    • Gravatar.com usage is opt-in and gravatars are only displayed if the exist.
    • The default behavior for legacy comments can be customized via the avatar_privacy_gravatar_use_default filter hook.
  • Change: All static default icons are now SVG images.