Og:URL Missing in OpenGraph²

#21647
  • Resolved Julien Blary
    Rank Math pro

    Hi,
    How are you ?

    I’m contact you again about my problem of og: url missing!

    I asked you few weeks ago but I didn’t not have an answer from you and I forgot to contact you again : https://support.rankmath.com/ticket/ogurl-missing-in-opengraph/

    Indeed, I don’t have an og:url in my OpenGraph. Where do we fix that? Does anyone know how to fix that?

    We have disabled all plugins for testing and there is no conflict. So it has to come from Rank Math. Can you tell me what’s wrong? Or how to add it?

    Tell me if you have any idea,

    Best,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I am having a bit of trouble trying to check for conflicts using the Health check plugin on your site. Could I have your permission to manually disable plugins or you could share some access to a clone of this site?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Julien Blary
    Rank Math pro

    Hi !
    Sure, let me update the preprod, our test site, later this day and I send you logs

    Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    I am looking forward to your response.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Julien Blary
    Rank Math pro

    Hi !
    How are you ?

    It’s ok for use the preprod. You can connect with the same log in Sensitive Date.

    Best

    Julien Blary
    Rank Math pro

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    The following code to remove the Rank Math canonical is responsible for the missing og:url tag on your pages:

    // Remove WordPress's default canonical handling function
    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
        return'';
    }); 

    I have modified the following filter on your theme to add this tag as shown below:

    add_filter('wp_head', 'fsp_rel_canonical');
    
    function fsp_rel_canonical()
    {
    	global $current_fp, $wp_the_query;
    	$current_fp = get_query_var('fpage');
    
        if (!is_singular())
            return;
    
        if (!$id = $wp_the_query->get_queried_object_id())
            return;
    
        $link = trailingslashit(get_permalink($id));
    
        // Make sure fake pages' permalinks are canonical
    	if (!empty($current_fp)) {
    		$link .= user_trailingslashit($current_fp);	
    	}
    
        echo '<link rel="canonical" href="'.$link.'" />';
    	echo '<meta property="og:url" content="'.$link.'">';
    }

    Looking forward to helping you. Thank you.

    ​​​​​​

    Julien Blary
    Rank Math pro

    Hi,
    That’s perfet, thanks !

    Michael Davis
    Rank Math pro

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘Og:URL Missing in OpenGraph²’ is closed to new replies.