Skip to content

Multisite and Storage

John James Jacoby edited this page Oct 6, 2026 · 1 revision

Multisite and Storage

WP User Avatars supports activation on an individual site or across a network. Network activation loads the plugin everywhere, but avatar settings such as Block Gravatar and Custom Default Avatar remain site-specific WordPress options.

User data and site files

In WordPress multisite, the user account and its user metadata are shared across the network. A user's wp_user_avatars value therefore follows the user between sites.

The underlying image still belongs to a site:

  • A direct upload is written through the current site's upload system.
  • A Media Library selection stores the attachment ID and owning site ID.
  • The custom default avatar under Settings > Discussion is site-specific.

When resolving a Media Library avatar, the plugin switches to the owning site before asking WordPress for its file and URL. This also lets storage plugins resolve remotely hosted attachments through WordPress's attachment APIs.

Removal and ownership

Removing an avatar always clears the user's avatar and rating metadata.

  • Files created by a direct avatar upload are plugin-owned and are removed when the plugin can resolve them in the active site's upload directory.
  • A Media Library attachment is not deleted when it is removed as a user's avatar. It remains an ordinary attachment owned by its site.

For multisite maintenance, perform direct-upload replacement or cleanup from the site that owns the upload. A network user can be edited from several sites, but that does not move the underlying file between upload directories.

Domain and HTTPS changes

The plugin preserves stored external URLs. For a local avatar stored with an HTTP URL, it upgrades the returned URL to HTTPS only when the owning site's home or site URL uses HTTPS on the same host and port. It does not rewrite the stored metadata merely because the current request is HTTPS.

After domain mapping or a migration:

  1. Update WordPress's home, site, upload, and attachment URLs through the normal migration process.
  2. Verify a direct upload and a Media Library avatar separately.
  3. Verify the avatar from a second site in the network.
  4. Confirm that the old host is not present in page source or network requests.

Remote storage

Media Library avatars use get_attached_file(), wp_get_attachment_image_url(), and wp_get_attachment_url(). Storage integrations that correctly implement those WordPress APIs can provide the remote URL.

Direct avatar uploads are stored as URLs and plugin-generated derivatives use the active upload directory. Test direct uploads separately when an offload plugin rewrites URLs, moves files immediately, or replaces the local stream. Selecting an existing Media Library attachment is generally the more portable path for remote storage.

Clone this wiki locally