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

Question

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.

0
popquiz 1 year 2022-01-19T15:31:49-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse