Site icon Hip-Hop Website Design and Development

How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?

How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?

function theme_a_header_metadata() {

  global $post;

  $image = wppluginblogwidgetgetBlogImage($post);

?>

  <meta property="og:image" content="<?= getLocalImage($image, '1344x') ?>" />

<?php

}
add_action( 'wp_head', 'theme_a_header_metadata' );

So I have this function, but the issue is that there’s already a meta property with the property value of "og:image", so how do I replace the meta tag? I need to use the backend, and I don’t want to install any plugin.