Tech

How to use Gravatar and force HTTPS?

Author By Chandan Kumar
December 6, 2017
8 min read
Share:
How to use Gravatar and force HTTPS

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.

Chandan Kumar

Chandan Kumar

Related Articles

Continue reading with these hand-picked articles on similar topics.

The Beginner’s Guide to Headless WordPress with React and WPGraphQL
WordPress
The Beginner’s Guide to Headless WordPress with React and WPGraphQL
Headless WordPress with front-end JavaScript library React and WP plugin WPGraphQL lets you use WordPress purely for content management.
Chandan Kumar August 4, 2025
Website Launch Checklist 2025: 20+ Ultimate Before and After Launch Tasks
Tech
Website Launch Checklist 2025: 20+ Ultimate Before and After Launch Tasks
Launching a website? Don’t miss a step! This all-in-one checklist covers everything from planning to promotion for a seamless, successful launch.
Chandan Kumar March 24, 2025
Top Free & Paid Optimization Plugins to Supercharge WordPress Sites in 2025
WordPress
Top Free & Paid Optimization Plugins to Supercharge WordPress Sites in 2025
Struggling with a slow WordPress site? Discover the best speed optimization plugins to boost performance, enhance UX, and rank higher on Google.
Chandan Kumar March 21, 2025