This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Issue with information being loaded insecurely after results load

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Issue with information being loaded insecurely after results load Reply To: Issue with information being loaded insecurely after results load

#29686
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

It usually happens when a site was previously used via the HTTP protocol, and was moved to SSL via a plugin. Those plugins find and replace assets within page contents – usually images – that might still exist with the HTTP protocol URLs. The search tries to recognize these changes internally, but sometimes it fails. However this should be very easy to resolve via a small custom code snippet.

Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

add_filter('asp_results', 'asp_fix_https');
function asp_fix_https($results) {
  foreach ($results as $k=>&$v) {
    $v->content = str_replace('http:', 'https:', $v->content);
    $v->image =  str_replace('http:', 'https:', $v->image);
  }
  return $results;
}

This should do the trick.