Cannot replace og:url with wpseo_opengraph_url filter
-
Greetings,
I’m trying to write a dumb little filter to replace the og:url parameter with the https:// version of the page (in order to preserve share counts). However, despite the fact that the function *is* firing, as evidenced with error_log() calls showing up in the PHP log, the URL never gets replaced.
The code in functions.php is straightforward enough:
function my_opengraph_og_url( $url ) { return str_replace( 'https://', 'https://', $url ); } add_filter( 'wpseo_opengraph_url', 'my_opengraph_og_url' );
Running WP 4.9.8 and Yoast 8.3. Any ideas what I’m doing wrong?
Thanks,
Peter
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Cannot replace og:url with wpseo_opengraph_url filter’ is closed to new replies.