Tech

How to use Gravatar and force HTTPS?

Chandan Kumar
By Chandan Kumar
December 6, 2017
1 min read
Share The Blog:
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

Chandan Kumar doesn't just write code; he builds digital legacies. As the Founder and Team Lead at AvyaTech, Chandan combines high-level strategy with granular technical expertise to turn "what if" into "it's live." When he’s not steering his team through complex development sprints, he’s busy architecting the future of scalable, user-first technology.

Related Articles

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

WordPress Plugin Developers for Hire in 2026: A Complete Vetting Guide
WordPress
WordPress Plugin Developers for Hire in 2026: A Complete Vetting Guide
Hiring a WordPress plugin developer sounds simple enough — until you’re three weeks in, the plugin breaks on a routine core update, and the developer has stopped responding. It happens more than it should. This guide gives you a practical framework for finding, screening, and hiring WordPress plugin developers in 2026 — whether you need […]
Chandan Kumar July 9, 2026
Hire a WordPress Theme Developer in 2026: Costs, Skills & What to Expect
WordPress
Hire a WordPress Theme Developer in 2026: Costs, Skills & What to Expect
Finding a good WordPress theme developer sounds simple until you actually start looking. Rates vary wildly, skill levels are hard to verify from a portfolio alone, and the gap between someone who customizes a pre-built theme and someone who builds from scratch is significant — in both cost and outcome. This guide covers what you […]
Chandan Kumar July 8, 2026
How to Build a Headless Website Using WordPress as a CMS?
WordPress
How to Build a Headless Website Using WordPress as a CMS?
The basic structure of WordPress is simple: a request is processed by PHP, which queries the MySQL database for content and uses a theme to render the final HTML. That pipeline connects the CMS and the frontend, which works fine until you need to serve content on more than one channel, reach a performance limit, […]
Chandan Kumar April 2, 2026