<?php

/**
 * Make canonical URLs refer to HTTP
 *
 * Make rel="canonical" links always refer to the non-https version of a page. Without this, it always points at the current protocol, which makes no sense.
 */
function replace_https($original_url) {
    if (
strpos($original_url'https://') === 0) {
        return 
substr_replace($original_url'http'05);
    }
}
add_filter('get_canonical_url''replace_https');