{"id":3531,"date":"2008-07-31T20:56:35","date_gmt":"2008-07-31T15:26:35","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=3531"},"modified":"2026-10-12T09:56:03","modified_gmt":"2026-10-12T04:26:03","slug":"how-to-add-gravatars-to-wordpress-themes","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/","title":{"rendered":"How to Add Gravatars to WordPress Themes (Classic and Block)"},"content":{"rendered":"<p>Want to add Gravatars to your WordPress theme? Gravatars (globally recognised avatars) show each commenter&#8217;s picture next to their comment, which makes discussions feel more personal and helps regular readers stand out. WordPress has supported them out of the box since 2008, when we first added them to our QuickPress theme. Here&#8217;s how to <strong>add Gravatars to WordPress themes<\/strong> in 2026, for classic and block themes, plus default avatar and privacy options.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-64182\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes-1024x538.webp\" alt=\"How to add Gravatars to WordPress themes\" width=\"1024\" height=\"538\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes-768x403.webp 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/add-gravatars-wordpress-themes.webp 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Go to Settings &gt; Discussion, tick <strong>Show Avatars<\/strong>, choose a maximum rating and a default avatar. Most themes then show Gravatars automatically. In a classic theme without them, add <code>get_avatar( $comment, 48 )<\/code> to your comment template or set <code>avatar_size<\/code> in <code>wp_list_comments()<\/code>. In a block theme, add the Avatar block inside the Comment Template block.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_88 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6acf436f78698\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6acf436f78698\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#1_Turn_on_avatars\" >1. Turn on avatars<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#2_Add_Gravatars_to_a_classic_theme\" >2. Add Gravatars to a classic theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#3_Add_Gravatars_to_a_block_theme\" >3. Add Gravatars to a block theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#4_Choose_a_better_default_avatar\" >4. Choose a better default avatar<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#5_Style_the_avatar_with_CSS\" >5. Style the avatar with CSS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#Privacy_and_speed\" >Privacy and speed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#Get_your_own_Gravatar\" >Get your own Gravatar<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#Why_are_Gravatars_not_showing_on_my_site\" >Why are Gravatars not showing on my site?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#How_do_I_change_my_Gravatar\" >How do I change my Gravatar?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/how-to-add-gravatars-to-wordpress-themes\/#Can_I_disable_Gravatars_completely\" >Can I disable Gravatars completely?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Turn_on_avatars\"><\/span>1. Turn on avatars<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In WordPress admin go to <strong>Settings &gt; Discussion &gt; Avatars<\/strong> and tick <strong>Show Avatars<\/strong>. Here you also set:<\/p>\n<ul>\n<li><strong>Maximum rating:<\/strong> G (suitable for all audiences) hides avatars rated PG, R or X.<\/li>\n<li><strong>Default avatar:<\/strong> what people without a Gravatar see (see step 4).<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"2_Add_Gravatars_to_a_classic_theme\"><\/span>2. Add Gravatars to a classic theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Most themes already call <code>wp_list_comments()<\/code>, which shows avatars at 32 px by default. Change the size in your child theme&#8217;s <code>comments.php<\/code>:<\/p>\n<pre><code>&lt;?php wp_list_comments( array( 'avatar_size' =&gt; 48 ) ); ?&gt;<\/code><\/pre>\n<p>If your theme uses a custom comment callback, add this where the avatar should appear:<\/p>\n<pre><code>&lt;?php echo get_avatar( $comment, 48 ); ?&gt;<\/code><\/pre>\n<p>Here&#8217;s more on how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/01\/how-to-change-avatar-size-in-wordpress-comments\/\">change avatar size in WordPress comments<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Add_Gravatars_to_a_block_theme\"><\/span>3. Add Gravatars to a block theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In <strong>Appearance &gt; Editor<\/strong>, open the single post template, select the <strong>Comments<\/strong> block and its <strong>Comment Template<\/strong>, and insert an <strong>Avatar<\/strong> block. You can set size and rounded corners in the block settings, without code.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Choose_a_better_default_avatar\"><\/span>4. Choose a better default avatar<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Not every commenter has a Gravatar. Instead of the grey Mystery Person, pick a generated avatar so each person gets a unique image:<\/p>\n<ul>\n<li><strong>Identicon:<\/strong> geometric pattern<\/li>\n<li><strong>Wavatar:<\/strong> friendly faces (our long-time favourite)<\/li>\n<li><strong>MonsterID:<\/strong> cartoon monsters<\/li>\n<li><strong>Retro:<\/strong> 8-bit pixel faces<\/li>\n<li><strong>RoboHash:<\/strong> robots<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"5_Style_the_avatar_with_CSS\"><\/span>5. Style the avatar with CSS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Avatars have the <code>.avatar<\/code> class. For round avatars floated left of each comment, add this in <strong>Appearance &gt; Customize &gt; Additional CSS<\/strong>:<\/p>\n<pre><code>.comment-list .avatar {\n  float: left;\n  margin: 0 12px 0 0;\n  border-radius: 50%;\n}<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Privacy_and_speed\"><\/span>Privacy and speed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Gravatar works from a hash of the commenter&#8217;s email address. Mention it in your privacy policy, as WordPress&#8217;s default policy text suggests.<\/li>\n<li>Each avatar is an image request to Gravatar&#8217;s servers. On posts with hundreds of comments, <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2021\/01\/lazy-load-comments-in-wordpress-blogs\/\">lazy load comments<\/a> to keep pages fast.<\/li>\n<li>Prefer to host avatars yourself? Plugins such as Simple Local Avatars let users upload a profile picture instead.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Get_your_own_Gravatar\"><\/span>Get your own Gravatar<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Sign up free at <a href=\"https:\/\/gravatar.com\/\" target=\"_blank\" rel=\"noopener\">Gravatar.com<\/a> with the email you use to comment. Your picture then appears on millions of WordPress sites, including this one.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Why_are_Gravatars_not_showing_on_my_site\"><\/span>Why are Gravatars not showing on my site?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Check Show Avatars is ticked, your theme outputs avatars, and that a caching or privacy plugin isn&#8217;t blocking gravatar.com.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_change_my_Gravatar\"><\/span>How do I change my Gravatar?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Log in to Gravatar.com and upload a new image. Changes may take a little while to appear because of caching.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_disable_Gravatars_completely\"><\/span>Can I disable Gravatars completely?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. Untick Show Avatars in Settings &gt; Discussion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to add Gravatars to your WordPress theme? Gravatars (globally recognised avatars) show each commenter&#8217;s picture next to their comment,&#8230;<\/p>\n","protected":false},"author":4,"featured_media":64182,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-3531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/3531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=3531"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/3531\/revisions"}],"predecessor-version":[{"id":64183,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/3531\/revisions\/64183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/64182"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=3531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=3531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=3531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}