Topics:

What are Avatars Used For?

Avatars are little pictures used to distinguish users in chat or comment sections.

Avatars imageAvatars can be a fun way to personalize user interaction on your site. Users can pick their own pictures for avatars, but you can choose the default image for users who don’t choose. WordPress also enables you to choose a rating for avatars. These ratings are similar to those used for movies: G, PG, R, and X.

Find Your Avatar Settings

  1. Log in to your WordPress admin account. You can do this by adding /wp-admin to the end of your site URL
  2. Hover over Settings in the left sidebar
  3. Click Discussion
  4. Scroll down to the Avatars section

This is where you can see your avatar settings. You can do the following here:

  • Enable/disable avatars
  • Enable/disable hovercards with user information
  • Change maximum avatar rating
  • Select a default avatar

Adding New Default Avatars

If you want to add your own custom default avatars, you have to be able to access your WordPress theme’s files.

  1. Access your WordPress theme’s files
  2. Open function.php file
  3. In this file, add the following code:
<?php
add_filter( 'avatar_defaults', 'new_default_avatar' );

function new_default_avatar ( $avatar_defaults ) {
 //add URL to where your avatar image is located
 $new_avatar_url = get_bloginfo( 'template_directory' ) . '/images/new_default_avatar.png';
 //Add the name of the avatar. This will appear to the right of the avatar in 
 //your settings
 $avatar_defaults[$new_avatar_url] = 'Default Name';
 return $avatar_defaults;
}
?>

Change /image/new_default_avatar.png with the file path of your new avatar.

Change Default Name to the name you want to be displayed with the avatar.

Once this file has been saved with the new code, your new avatar will appear in your avatar settings, where you can select it as a default avatar.