在wordpress帖子/页面中添加自定义元标记

I am using wordpress site with URL Params plugin to pass the variable from one page to another, and using that variable value to create the image on my site. Now the problem is that: while sharing that post on facebook, image is not showing up because of the below problem shown in the image.

What happen in the above situation is the Fetched URL is correct:

abc.com/your-result-is-ready-7/?id=1119647968071119

but the Canonical URL is:

abc.com/your-result-is-ready-7/

Because of missing variable value, the image is also not created.

So, is there any way to set the custom og image url in wordpress post to show up the proper image when the post is shared on facebook or any other way to get rid of the issue?

yes you can use this on your functions.php file so your featured image will be your og:image or you can change its code to use another image also or use yoast maybe

add_action( 'wp_head', 'og_tags' );
function og_tags() {
  if( is_single() ) {
      if ( has_post_thumbnail() ) :
        $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); 
    ?>
      <meta property="og:image" content="<?php echo $image[0]; ?>"/>  
    <?php endif;
  }
}
?>