Diferentes funciones con su correspondiente filtro para modificar los datos de OpenGraph que genera Yoast. Puedes utilizar todos o solo una de ellos.
<?php /* Change size for Yoast SEO OpenGraph image for all content */ add_filter( 'wpseo_opengraph_image_size', 'yoast_seo_opengraph_change_image_size' ); function yoast_seo_opengraph_change_image_size( $string ) { return 'medium_large'; } /* Change Open Graph image URLs in Yoast SEO*/ add_filter( 'wpseo_opengraph_image', 'change_opengraph_image_url' ); function change_opengraph_image_url( $url ) { return str_replace('current_domain.com', 'new_domain.com', $url); } /* Enforce HTTP Open Graph URLs in Yoast SEO*/ add_filter( 'wpseo_opengraph_url', 'my_opengraph_url' ); function my_opengraph_url( $url ) { return str_replace( 'https://', 'http://', $url ); } /* Change Yoast SEO OpenGraph type*/ add_filter( 'wpseo_opengraph_type', 'yoast_change_opengraph_type', 10, 1 ); function yoast_change_opengraph_type( $type ) { /* Make magic happen here. Example below changes the homepage to a book type */ if ( is_home() ) { return 'book'; } else { return $type; } } /* Remove All Yoast SEO OpenGraph Output*/ add_action('wp_head', 'remove_all_wpseo_og', 1); function remove_all_wpseo_og() { remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 ); } /* Remove Yoast SEO OpenGraph Output From One Post/Page*/ add_action('wp_head', 'remove_one_wpseo_og', 1); function remove_one_wpseo_og() { if ( is_single ( 123456 ) ) { //También puedes usar un array de IDs o usar la función is_singular para diferentes post_types. remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 ); } /* Use a second if statement here when needed */ } /* Remove Individual Yoast SEO OpenGraph meta tags*/ add_filter('wpseo_opengraph_url' , '__return_false' ); add_filter('wpseo_opengraph_desc', '__return_false' ); add_filter('wpseo_opengraph_title', '__return_false' ); add_filter('wpseo_opengraph_type', '__return_false' ); add_filter('wpseo_opengraph_site_name', '__return_false' ); add_filter('wpseo_opengraph_image' , '__return_false' ); add_filter('wpseo_opengraph_author_facebook' , '__return_false' );