Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Plugin Name: Force HTTP sharing URL
Description: Make og:url HTTP in Yoast and Jetpack meta data
Version: 20181127
Author: kristarella
License: GPL2
License URI:
/* Enforce HTTP Open Graph URLs in Yoast SEO
* Credit: stodorovic
* Last Tested: Feb 06 2017 using Yoast SEO 5.8 on WordPress 4.8.2
add_filter( 'wpseo_opengraph_url', 'yoast_http_og_url' );
function yoast_http_og_url( $url ) {
return str_replace( 'https://', 'http://', $url );
/* Enforce HTTP Open Graph URLs in Jetpack
add_filter( 'jetpack_open_graph_tags', 'jetpack_http_og_url' );
function jetpack_http_og_url( $tags ) {
$tags['og:url'] = str_replace( 'https://', 'http://', $tags['og:url'] );
return $tags;
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.