manifest / performance / wp-local-avatars
Local Avatars
Cache Gravatar images locally and serve avatars from your own domain — faster, privacy-friendly WordPress avatars.
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/azanumer/wp-local-avatars/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Cache Gravatar images locally in your uploads folder and serve them from your own domain — faster avatars, no third-party requests on every page load, and friendlier for privacy regulations (no visitor data sent to Gravatar on every view).
Features
- Local serving — avatars are downloaded once from Gravatar and served from
wp-content/uploads/local-avatars/. - Automatic refresh — cached copies are re-downloaded after the refresh window (default 7 days); a weekly WP-Cron job drops stale files so no visitor ever waits on a Gravatar download.
- Stale-copy fallback — if Gravatar is unreachable, the last cached copy keeps serving instead of breaking the layout.
- Image-only cache — only responses with an
image/*content type are stored, so an error page can never be cached as an avatar. - Atomic writes — downloads go to a temp file first, then
rename(), so concurrent requests never see a half-written image. - Works everywhere — hooks
pre_get_avatar_data, so it coversget_avatar(), comments, author boxes and anything else using the avatar API. - Settings — enable/disable, maximum size (32–512px), refresh window (1–90 days), Gravatar default style, one-click cache purge under Settings → Local Avatars.
Installation
- Upload the
wp-local-avatarsfolder to/wp-content/plugins/. - Activate the plugin through Plugins in WordPress admin.
- Avatars are cached automatically from the next page load.
Uninstall
Deleting the plugin removes the wla_settings option, clears the weekly cron event and deletes the cached avatar files (they are regenerable copies of public Gravatars).
License
MIT — see LICENSE.