Skip to content

How to disable Gravatars in WordPress?

Gravatars is a service that offers globally recognizable avatars. Many WordPress users use Gravatars to add graphical personalization to their blog comments. However, some WordPress users may not like the use of Gravatars on their websites. Whether for privacy, performance or GDPR compliance reasons, disabling Gravatars in WordPress is quite simple. In this article, we will discuss several ways to disable Gravatars in WordPress.

Disabling Gravatars via WordPress Discussion Settings

The first and easiest way is to use the WordPress settings. You can do this by going to Settings > Discussion in the WordPress administration panel.

Under the heading Avatars, there is an option Show avatars. By unchecking this box, you will disable Gravatars for your entire website. Remember to click on save Changes at the bottom of the page for your settings to be updated.

Disabling Gravatars using PHP code

It is also possible to disable Gravatars using PHP code. This method is more technical and requires adding code to your WordPress theme files.

To do this, open the functions.php file in your WordPress theme directory and add the following code:

add_filter( 'get_avatar', '__return_false' );

This code blocks the function get_avatar, which is responsible for displaying Gravatars. After adding this code, remember to save and close the file.

Disabling Gravatars using a plugin

Last but not least is to use a plugin. There are WordPress plugins that can help you disable Gravatars. For example, you can use a plugin called Disable User Gravatar.

To install the plugin, go to Plugins > Add new in the WordPress administration panel. Then type Disable User Gravatar in the search box and click install now. After installing the plugin, click Activate.

This plugin will automatically disable Gravatars for your website.

Remember that the choice of method depends on your comfort with technology and your individual needs. Whichever method you choose, disabling Gravatars on your WordPress site should be simple and hassle-free.

Check out the offer of 1500+ Premium WordPress plugins and themes!