Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change https to http urls in Yoast SEO
* Plugin Name: Open Graph URLs for facebook
* Plugin URI:
* Description: Change all your https url to http for facebook for Yoast SEO
* Author: Shubham Pandey
* Version: 1.0.0
* Author URI:
* License: GPL2+
* @package CustomURLs
* Function replaces https to http in urls
* @param string $url url link for replacing
function spx_change_https( $url ) {
return str_replace( 'https://', 'http://', $url );
// Filter for open graph url.
add_filter( 'wpseo_opengraph_url', 'spx_change_https' );
// Filter for canonical url.
add_filter( 'wpseo_canonical', 'spx_change_https' );
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.