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'] ) ? 'https://' : '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?
Best regards!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘og:url does not point to canonical URL’ is closed to new replies.