Title: mixed content error using https:
Last modified: August 30, 2016

---

# mixed content error using https:

 *  Resolved [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/)
 * Hi
 * Installed plugin here – [https://thebeautifulhousecompany.com/contact2/](https://thebeautifulhousecompany.com/contact2/)
 * In chrome debugger it shows a warning –
    Mixed Content: The page at [https://thebeautifulhousecompany.com/contact2/&#8217](https://thebeautifulhousecompany.com/contact2/&#8217);
   was loaded over HTTPS, but requested an insecure image ‘[http://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif&#8217](http://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif&#8217);.
   This content should also be served over HTTPS.
 * In IE11 debugger it shows 3 errors (the below error repeated) –
    SEC7111: HTTPS
   security is compromised by [http://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif](http://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif)
   File: contact2
 * which module loads ajax-loader.gif? I’m hoping I can edit it to point to https
   🙂
 * Also in IE11 the date picker doesn’t work, it does in chrome.
 * Cheers
    Chris
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712355)
 * What cache plugin do you use?
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712398)
 * Hi
 * I use the quickcache plugin.
 * The SSL is enabled via Cloudflare, it is set to divert all http: requests to 
   https:
 * Cheers
    Chris
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712443)
 * > The SSL is enabled via Cloudflare, it is set to divert all http: requests to
   > https:
 * Maybe that is the problem. Your WordPress can’t recognize whether it is in HTTPS
   or HTTP when rendering a page.
 * Doesn’t Cloudflare have an option to overwrite all link URLs in a page with HTTPS
   versions?
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712461)
 * [@kizora](https://wordpress.org/support/users/kizora/): Try to add this to your
   theme `functions.php` file.
 *     ```
       function my_wpcf7_ajax_loader( $url ) {
       	return str_replace( 'http://', '//', $url );
       }
       add_filter( 'wpcf7_ajax_loader', 'my_wpcf7_ajax_loader', 10, 1 );
       ```
   
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712483)
 * Hi Takayuki
    Yes, I do have Cloudflare set to overwrite all link URLS with https.
   Everything else gets overwritten ok except for this plugin and an old cforms 
   plugin where I had to hard code the https
 * Hi Ov3rfly
    Thanks for the code – what does it do?
 * Cheers
    Chris
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712485)
 * [@kizora](https://wordpress.org/support/users/kizora/): The code fixes the “Mixed
   Content” problem for `ajax-loader.gif`
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712498)
 * > Yes, I do have Cloudflare set to overwrite all link URLS with https.
 * Does this cover `<img src="..." />` URLs?
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712504)
 * Hi Ov3rfly
    I added that code but got a server error 500 when I tried to update
   the contact page in wordpress admin – “The website encountered an error while
   retrieving [http://thebeautifulhousecompany/wp-admin/post.php](http://thebeautifulhousecompany/wp-admin/post.php).
   It may be down for maintenace or configured incorrectly” It wasn’t down for maintenance.
 * I added the code here
    ‘ <?php }
 * function my_wpcf7_ajax_loader( $url ) {
    return str_replace( ‘[http://&#8217](http://&#8217);,‘//’,
   $url ); } add_filter( ‘wpcf7_ajax_loader’, ‘my_wpcf7_ajax_loader’, 10, 1 );
 * function register_main_menus() {
    register_nav_menus( array( ‘primary-menu’ =
   > __( ‘Primary Menu’ ), ‘secondary-menu’ => __( ‘Secondary Menu’ ) ) ); }; ‘ 
   Cheers Chris
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712505)
 * Hi Takayuki,
    It is set to cover everything but I wonder whether it’s resolving
   the ajax-loader.gif url after cloudflare has converted http to https?
 * In the plugins functions.php file there is this code:-
    ‘ function wpcf7_ajax_loader(){
   $url = wpcf7_plugin_url( ‘images/ajax-loader.gif’ );
 *  return apply_filters( ‘wpcf7_ajax_loader’, $url );
    } ‘
 * Could I just hard code the https: ? by changing it to:
    ‘ $url = ( “[https://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif&#8221](https://thebeautifulhousecompany.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif&#8221););‘
   Cheers Chris
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712514)
 * [@kizora](https://wordpress.org/support/users/kizora/): There is an extra `}`
   right after `<?php` which should not be there and probably causes the error.
 * The filter replaces `http://` with `//` which makes `ajax-loader.gif` url [protocol-relative](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#prurl),
   similar to many other resources on your website (see html source at end of page).
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712517)
 * Hi Ov3rfly
 * Sorry, should have copied the whole php file. That } is the end of the media 
   queries bit. Here’s the whole function.php
    ‘ <?php add_action( ‘after_setup_theme’,‘
   et_setup_theme’ ); if ( ! function_exists( ‘et_setup_theme’ ) ){ function et_setup_theme(){
   remove_action( ‘wp_head’, ‘feed_links’ ); remove_action( ‘wp_head’, ‘rsd_link’);
   remove_action( ‘wp_head’, ‘wlwmanifest_link’); remove_action( ‘wp_head’, ‘index_rel_link’);
   remove_action( ‘wp_head’, ‘parent_post_rel_link’); remove_action( ‘wp_head’, ‘
   start_post_rel_link’); remove_action( ‘wp_head’, ‘adjacent_posts_rel_link’); 
   remove_action( ‘wp_head’, ‘wp_generator’);
 * remove_action(‘wp_head’, ‘print_emoji_detection_script’, 7);
    remove_action(‘
   wp_print_styles’, ‘print_emoji_styles’); remove_action(‘admin_print_scripts’,‘
   print_emoji_detection_script’ ); remove_action(‘admin_print_styles’, ‘print_emoji_styles’);
 *  require_once(TEMPLATEPATH . ‘/epanel/custom_functions.php’);
    require_once(TEMPLATEPATH.‘/
   includes/functions/comments.php’); require_once(TEMPLATEPATH . ‘/includes/functions/
   sidebars.php’); load_theme_textdomain(‘ElegantEstate’,get_template_directory().’/
   lang’); require_once(TEMPLATEPATH . ‘/epanel/options_elegantestate.php’); require_once(
   TEMPLATEPATH . ‘/epanel/core_functions.php’); require_once(TEMPLATEPATH . ‘/epanel/
   post_thumbnails_elegantestate.php’); include(TEMPLATEPATH . ‘/includes/widgets.
   php’); require_once(TEMPLATEPATH . ‘/includes/functions/additional_functions.
   php’); } } // Add MEDIA QUERIES …………. add_action(‘wp_head’,’et_portfoliopt_additional_styles’,
   100); function et_portfoliopt_additional_styles(){ ?> <style type=”text/css”>#
   et_pt_portfolio_gallery { margin-left: -15px; } .et_pt_portfolio_item { margin-
   left: 21px; }
 *  .et_portfolio_small { margin-left: -40px !important; }
    .et_portfolio_small .
   et_pt_portfolio_item { margin-left: 38px !important; }
 *  [@media](https://wordpress.org/support/users/media/) only screen and (max-width:
   720px){
    .et_portfolio_small { margin-left: 0px !important; } .et_portfolio_small.
   et_pt_portfolio_item { margin-left: 5% !important; } }
 *  [@media](https://wordpress.org/support/users/media/) only screen and (max-width:
   359px){
    .et_portfolio_small { margin-left: -4px !important;} .et_portfolio_small.
   et_pt_portfolio_item { margin-left: 2px !important; } }
 *  .et_portfolio_large { margin-left: -8px !important; }
    .et_portfolio_large .
   et_pt_portfolio_item { margin-left: 6px !important; } </style> <?php }
 * function my_wpcf7_ajax_loader( $url ) {
    return str_replace( ‘[http://&#8217](http://&#8217);,‘//’,
   $url ); } add_filter( ‘wpcf7_ajax_loader’, ‘my_wpcf7_ajax_loader’, 10, 1 );
 * function register_main_menus() { register_nav_menus( array( ‘primary-menu’ =>
   __( ‘Primary Menu’ ), ‘secondary-menu’ => __( ‘Secondary Menu’ ) ) );};
    if (
   function_exists(‘register_nav_menus’)) add_action( ‘init’, ‘register_main_menus’);
 * if ( ! function_exists( ‘et_list_pings’ ) ){ function et_list_pings($comment,
   $args, $depth) { $GLOBALS[‘comment’] = $comment; ?> <li id=”comment-<?php comment_ID();?
   >”><?php comment_author_link(); ?> – <?php comment_excerpt(); ?> <?php }}
    add_action(‘
   template_redirect’,’check_listing’); function check_listing() { if (isset($_REQUEST[“
   option-listing”])) { $category_link = get_category_link( $_REQUEST[“option-listing”]);
   wp_redirect($category_link); } } function SearchFilter($query) { if ($query->
   is_search) { $query->set(‘post_type’, ‘post’); } return $query; }
 * if( !is_admin() ) add_filter(‘pre_get_posts’,’SearchFilter’);
 * add_filter(‘body_class’,’et_additional_body_class’);
    function et_additional_body_class(
   $classes) { if ( !is_home()) $classes[] = ‘index’;
 *  return $classes;
    } ?> ‘
 *  [ov3rfly](https://wordpress.org/support/users/ov3rfly/)
 * (@ov3rfly)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712521)
 * Looks good, not sure why you get an error.
 * To track down the problem, here a version of the filter which does nothing, it
   just returns the given url. If this version causes an error 500, something basic
   might be wrong with your `functions.php` editing:
 *     ```
       function my_wpcf7_ajax_loader( $url ) {
       	return $url;
       }
       add_filter( 'wpcf7_ajax_loader', 'my_wpcf7_ajax_loader', 10, 1 );
       ```
   
 * Another version which replaces `http` with `https`, in case the cloudflare can’t
   handle the escaped protocol-relative `//`
 *     ```
       function my_wpcf7_ajax_loader( $url ) {
       	return str_replace( 'http://', 'https://', $url );
       }
       add_filter( 'wpcf7_ajax_loader', 'my_wpcf7_ajax_loader', 10, 1 );
       ```
   
 * Only use one filter at a time and do not change anything else in settings etc.
 * PS. There is no need to re-save the form or page or similar. Just add the filter
   and reload the contact page in frontend.
 *  Thread Starter [kizora](https://wordpress.org/support/users/kizora/)
 * (@kizora)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712527)
 * Excellent! thanks very much Ov3rfly. That code worked 🙂
    Cheers, Chris
 *  [brucewilliam](https://wordpress.org/support/users/brucewilliam/)
 * (@brucewilliam)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712644)
 * [@kizora](https://wordpress.org/support/users/kizora/) : will this code work 
   for me ? i am running gaming web page and flash games are creating mixed content
   problem for me. here is the error for reference
 * > swfobject.embedSWF( ‘[http://files.cdn.spilcloud.com/df9aa4793b5/APB-30-11/index.html&#8217](http://files.cdn.spilcloud.com/df9aa4793b5/APB-30-11/index.html&#8217);,‘
   > myarcade_swfobject_content’, ‘807’, ‘633’, ‘9.0.0’, ”, [], {“wmode”:”direct”,”
   > allowscriptaccess”:”always”,”swLiveConnect”:”true”,”quality”:”high”}, []);”
 * my page is [https://www.coolmathgamestop.com](https://www.coolmathgamestop.com)

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘mixed content error using https:’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [date picker](https://wordpress.org/support/topic-tag/date-picker/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * 14 replies
 * 4 participants
 * Last reply from: [brucewilliam](https://wordpress.org/support/users/brucewilliam/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/mixed-content-error-using-https/#post-6712644)
 * Status: resolved