[Resolved] og:url does not point to canonical URL
When a post URL contains query string parameters (for example, Analytics campaign tracking utm_source, etc), the URL that is set in og:url is the same exact URL that was requested (lines 649-650):
$og['og:url'] = empty( $_SERVER['HTTPS'] ) ? 'http://' : 'https://'; $og['og:url'] .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
If we set the canonical URL instead, we will not lose Facebook likes when users access the page with different GET parameters:
$og['og:url'] = get_permalink( $post->ID );
Could it be merged to trunk?
- The topic ‘[Resolved] og:url does not point to canonical URL’ is closed to new replies.