Support » Plugins » Possible Fix for Favicon Not Being Delivered Over SSL in Admin

  • This is both a help inquiry and a possible solution:

    I set my admin to load via SSL using FORCE_SSL_ADMIN, but I was getting a security warning in my browser that some content was not delivered securely. I was able to narrow it down to the favicon image in the header. This probably isn’t a huge issue, but being OCD I decided to try to fix it. After digging around in the code a bit, I made a change to the wp_get_attachment_url function in wp-includes/post.php. I changed line 5076 from:

    if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {


    if ( is_ssl() && ((! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow']) || is_admin()) ) {

    and this seemed to solve the problem. I noticed it also fixed images not served over SSL on the Media Library page. I thought I would post this in case it would help anyone else, or in case someone had a better solution. Since I’m relatively new to WordPress, I don’t know yet if this could cause problems elsewhere (I’ll post back if I notice any problems) so I would appreciate any information from users who might know better.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Jamison


    How is your favicon loading? Through a theme? Because I’m having the same issue but I don’t even have a favicon.ico. I use site logo in customize and its still giving me the same error. I don’t even know where WP is referencing the favicon.

    I set mine up in the customize page (site identity > site icon). As far as I can tell, it’s vanilla wordpress functionality.

    This is a known bug which I have reported here

    Here is a temporary fix, place it in functions.php:

    // Fix
    add_filter( 'get_site_icon_url', 'set_url_scheme' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible Fix for Favicon Not Being Delivered Over SSL in Admin’ is closed to new replies.