How to use Gravatar and force HTTPS?

How to use Gravatar and force HTTPS

Request Free Consultation

"*" indicates required fields

Today I am writing about a very simple short but unique and informative post at AvyaTech. And this is about how to use gravatar and force https. I think this post is also helpful for bloggers who run their blogs on WordPress and create their profile on Gravatar as well.

There are many websites and blogs that are all over https and using gravatar to display their profile image like so:

but the Problem is that gravatar is http, and how can we make this https? Let’s get the start and use the following script to use gravatar and force https.

add_filter('get_avatar_url', 'set_https', 10, 3);

function set_https($url, $id_or_email, $args){
return set_url_scheme( $url, 'https' );;

Put this code in your active theme functions.php

I hope you people find this post helpful and don’t forget to share your feedback and question below in the comment box.

Let’s create something beautiful and innovative together! call us now!

Chat with our seniors to see if we have a good match



4 responses to “How to use Gravatar and force HTTPS?”
  1. Atul Host Avatar

    Awesome work man. For a secure website, it is required to load everything on https to avoid the mixed content issue.

    1. Absolutely True Atul.

  2. suresh lukhi Avatar

    This article important and really good the for me is.Amazing write-up, Great article. Thanks!

    1. Thank You, Suresh to visit on my Blog post.

Leave a Reply

Your email address will not be published. Required fields are marked *


Our recent post