How to Replace Gravatar with Custom Author Photos in WordPress

· 5 min read

WordPress relies on Gravatar for author profile photos. It's been this way since 2007, and while Gravatar served its purpose in the early days of blogging, it's become a source of frustration for many site owners. The service is slow, raises privacy concerns, and produces those unmistakable gray "mystery person" icons when an author hasn't configured a Gravatar account.

If you want professional-looking author photos on your WordPress site without depending on an external service, here are three practical ways to replace Gravatar with locally hosted custom images.

Problems with Gravatar

Performance Impact

Every time WordPress displays an avatar, it makes an HTTP request to gravatar.com. On a single post page, this might be one request for the author box and additional requests for every comment that shows an avatar. Each request introduces latency — DNS lookup, TLS handshake, and the image download itself. While individual requests are small, they add up.

More importantly, Gravatar requests are external — they're not served from your domain, so they can't benefit from your CDN, your server's HTTP/2 multiplexing, or your caching strategy. Page speed tools like Lighthouse regularly flag Gravatar as an unnecessary third-party dependency.

Privacy Concerns

Gravatar works by hashing email addresses and using the hash to retrieve images. Every avatar request sends this hash to Automattic's servers, which means Gravatar receives information about which pages your visitors are viewing (via the referrer) and can track visitors across every site that uses Gravatar.

Under GDPR, this constitutes transferring personal data to a third party without clear consent. Several GDPR compliance auditors flag Gravatar as a potential issue, and some European sites have disabled it entirely to avoid regulatory risk. If your site serves EU visitors, this is worth taking seriously.

Ugly Default Images

When an author doesn't have a Gravatar account — which is common for guest contributors and non-technical team members — WordPress shows a default placeholder. The "mystery person" silhouette, the geometric "identicon," or the monster face. None of these look professional on a business website. They undermine the credibility that a well-designed author box is supposed to build.

Dependency on an External Service

Your author photos shouldn't depend on a third-party service's uptime and availability. If Gravatar's servers are slow or down (which happens), your page layout shifts or displays broken images. You have no control over caching headers, image quality, or CDN distribution. For something as fundamental as author photos, local hosting gives you complete reliability.

Method 1: Tidy Author Box (Recommended)

Tidy Author Box includes a built-in custom avatar upload that completely replaces Gravatar for author photos. It's the simplest solution because it integrates directly into the WordPress user profile page.

How It Works

After installing Tidy Author Box, go to Users → Your Profile. You'll see a new Custom Avatar section above the standard WordPress fields. Click Upload Photo to select an image from your computer or choose one from the WordPress Media Library.

The uploaded photo is stored in your WordPress media library — on your server, under your control. When the author box displays, it uses the local image instead of making a Gravatar request. The plugin also serves the image through WordPress's standard image handling, which means it benefits from your CDN, lazy loading, and responsive image attributes.

Key Benefits

  • No external requests. Author photos are served from your own server or CDN. Zero third-party dependencies.
  • Works for all authors. Every author can upload a photo directly — no need to create a Gravatar account or link an email to a hash-based service.
  • Consistent quality. You control the image quality and dimensions. No surprises from low-resolution Gravatar uploads.
  • Graceful fallback. If a custom avatar isn't uploaded, the plugin can fall back to Gravatar or display a styled default — your choice.
  • GDPR-friendly. No visitor data is sent to third-party servers for avatar display.

Learn more about Tidy Author Box →

Method 2: Simple Local Avatars Plugin

If you only need local avatar uploads and don't want a full author box plugin, Simple Local Avatars is a focused, free plugin that does exactly what its name suggests.

After installation, it adds an avatar upload field to each user's profile page. Uploaded avatars replace Gravatar site-wide — in author boxes, comments, admin bars, and anywhere else WordPress calls get_avatar(). The plugin hooks into WordPress's avatar system at a low level, so it works with any theme or plugin that uses standard avatar functions.

Simple Local Avatars is well-maintained and lightweight. The main limitation is that it only handles avatars — it doesn't provide an author box, social links, or any other author profile enhancements. If you're already happy with your theme's author box and just want to eliminate Gravatar, it's a solid choice.

Method 3: Code Snippet in functions.php

For developers who prefer to avoid plugins for simple functionality, you can override WordPress's avatar system with a custom function in your child theme's functions.php.

The Approach

The strategy involves three steps:

  1. Add a custom meta field to user profiles for storing a local avatar image ID (from the Media Library).
  2. Build an upload interface on the user profile page using WordPress's media uploader JavaScript API.
  3. Filter the avatar output using the get_avatar or pre_get_avatar_data filter to return your local image instead of calling Gravatar.

Practical Considerations

This approach works, but there are details that make it more complex than it first appears:

  • The media uploader UI requires enqueueing the WordPress media scripts on the profile page and writing JavaScript to handle the upload modal. It's not a single line of code.
  • Image sizing. WordPress calls get_avatar() at different sizes (typically 32px, 64px, 96px, and sometimes custom sizes). Your filter needs to handle the size parameter and serve appropriately sized images, ideally using wp_get_attachment_image_src() with the right dimensions.
  • Caching compatibility. Some caching plugins cache Gravatar URLs aggressively. Your filter needs to run early enough to prevent cached Gravatar URLs from being served.
  • Multisite. On WordPress multisite, user meta is shared across sites but the Media Library is per-site. This creates edge cases if an author uploads their avatar on one site but writes on another.

For a single-site WordPress installation where you're comfortable writing PHP, this approach gives you complete control. But it's worth evaluating whether the time spent building and maintaining this code is justified when reliable plugins exist.

Privacy and GDPR Considerations

Replacing Gravatar with locally hosted photos has meaningful privacy benefits:

Eliminating Third-Party Data Transfer

With Gravatar, every page load that displays an avatar sends data to Automattic's servers. This includes the hashed email address, the visitor's IP address, the referring page URL, and browser information. Under GDPR, this constitutes processing personal data by a third party, which requires either consent or a legitimate interest justification.

Locally hosted avatars eliminate this data transfer entirely. The image is served from your own server (or CDN), and no information about the visitor is shared with any third party.

Simplified Privacy Policy

If you use Gravatar, your privacy policy needs to disclose this: which data is sent, to whom, for what purpose, and how users can opt out. By switching to local avatars, you can remove this entire section. Less third-party data processing means a simpler, more honest privacy policy.

Cookie Consent Implications

Some strict interpretations of GDPR require cookie consent for Gravatar because the external requests can set third-party cookies. By hosting avatars locally, you avoid this ambiguity entirely. Your avatar images are first-party content, treated no differently from any other image on your page.

Making the Switch

Whichever method you choose, here's a practical workflow for transitioning from Gravatar:

  1. Audit your current authors. Check which authors have Gravatar accounts and which show default placeholders. Focus first on getting custom photos for authors who currently show defaults.
  2. Collect professional photos. Ask each author for a high-quality headshot. Specify a minimum resolution (400x400 pixels works well) and a preferred format (JPEG for photos, PNG if transparency is needed).
  3. Upload and verify. Upload photos for each author and check that they display correctly in author boxes, comment sections, and anywhere else avatars appear.
  4. Disable Gravatar. In Settings → Discussion, you can uncheck "Show Avatars" to disable Gravatar entirely, or rely on your plugin/code to intercept avatar requests before they reach Gravatar.
  5. Update your privacy policy. If you were disclosing Gravatar usage, update your policy to reflect that avatars are now locally hosted.

Frequently Asked Questions

Will disabling Gravatar break comment avatars?

If you use a plugin like Tidy Author Box or Simple Local Avatars, comment avatars for registered users will display their uploaded photos instead of Gravatar. For anonymous commenters (who aren't registered users), avatars will fall back to the default placeholder you've configured in Settings → Discussion. You won't lose comment avatars entirely — you'll just stop pulling them from an external server.

Can I use both Gravatar and custom photos as a fallback chain?

Yes. Most local avatar solutions, including Tidy Author Box, support a fallback chain: first check for a custom uploaded avatar, then fall back to Gravatar if none exists. This is useful during a transition period when not all authors have uploaded custom photos yet. Once all authors have local photos, you can disable Gravatar entirely for maximum privacy and performance.

How much does replacing Gravatar improve page speed?

The improvement depends on how many avatars your pages display. For a typical blog post with one author box, you're eliminating one external HTTP request — which saves roughly 100-300ms depending on the visitor's connection. For comment-heavy posts with dozens of avatars, the improvement can be significant: eliminating 20+ external requests can shave 1-2 seconds off load time. Additionally, locally hosted images can be served through your CDN, use modern formats (WebP/AVIF), and benefit from browser caching on your domain.