Skip to content

Instantly share code, notes, and snippets.

@curt curt/README.markdown
Last active Jul 3, 2018

What would you like to do?
WordPress plugin that replaces http: with https: in any content containing the home URL wherever found in content requested via https.
* Plugin Name: AF7KQ Replace Home URLs
* Plugin URI:
* Description: Replaces http: URL containing the home URL with https: URL
* Version: 0.0.1
* Author: Curt Gilman
* Author URI:
add_filter( 'the_content', 'af7kq_filter_replace_home_urls' );
function af7kq_filter_replace_home_urls( $content ) {
if( is_ssl() ) {
$content = str_replace( set_url_scheme( home_url(), 'http' ), set_url_scheme( home_url(), 'https' ), $content);
return $content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.