meta og:image not working for my wordpress website using SSL

Viewed 3128

I am playing around with adding meta property to my wordpress website with SSL certified. I send the link to skype and whatsapp the og:image not working. I tried with many plugins and without plugin direct html code into my wordpress theme header but still not working. Anyone help me to guide with suitable plugin or wp code to achieve this. Thanks in Advance.

my website link

skype image

<meta property="og:site_name" content="Multi-functional Online Shopping Cart | 新山网店模板设计&nbsp;" />
<meta property="og:url" content="https://mybizcart.com.my" />
<meta property="og:locale" content="en_US" />
<meta property="og:title" content="Home" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://mybizcart.com.my/logo.jpg" />
<meta property="og:image:secure_url" content="https://mybizcart.com.my/logo.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
5 Answers

Your open graph data appears to be working fine (FB sharing debugger, iframely).

This points to an issue with Skype. Skype caches its link metadata (including images) both in the cloud and on your computer. There are instructions on the Skype forums to clear your local cache, but you’ll just have to wait for the cloud cache to update.

When I entered the link into a WhatsApp conversation, the image appeared as desired:

WhatsApp screenshot

I suspect Skype will follow suit shortly, and that this is just a caching issue. I’ve faced similar issues with Facebook & Twitter posts when updating metadata - in my experience it can take up to a week for the changes to propagate fully.

for whatsapp sharing you simply use

<a href="whatsapp://send?text=https://mybizcart.com.my/url_of_page/" target="_blank"><i class="fa fa-whatsapp fa-3x" aria-hidden="true"></i><span class="hidden-xs">whatsapp</span></a>

First, you can scan your URL on Social Debug I already scan your URL and Find some issue your ranking is C so try to make it A.

Also the same issue we face we wasted almost a week to figure out what happens some time cache or a server timeout.

enter image description here

Don't use plugins because it's a mash-up with your code output we made a simple script just that script at the end of your function.php file

//Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
        return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
    }
add_filter('language_attributes', 'add_opengraph_doctype');

//Lets add Open Graph Meta Info

add_action('wp_head', 'fc_opengraph');
function fc_opengraph() {
if( is_single() || is_page() ) {
$post_id = get_queried_object_id();
$url = get_permalink($post_id);
    $title = get_the_title($post_id);
    $site_name = get_bloginfo('name');
$description = wp_trim_words( get_post_field('post_content', $post_id), 25 );
$image = get_the_post_thumbnail_url($post_id);
    if( !empty( get_post_meta($post_id, 'og_image', true) ) ) 
    {   
        $image = get_post_meta($post_id, 'og_image', true);
    } else {
        $image = 'set your image URl here';
    }
$locale = get_locale();
    echo '<meta name="description" content="Put your website description here">';
    echo '<meta property="og:locale" content="' . esc_attr($locale) . '" />';
    echo '<meta property="og:type" content="article" />';
    echo '<meta property="og:title" content="' . esc_attr($title) . ' | ' . esc_attr($site_name) . '" />';
    echo '<meta property="og:description" content="' . esc_attr($description) . '" />';
    echo '<meta property="og:url" content="' . esc_url($url) . '" />';
    echo '<meta property="og:site_name" content="' . esc_attr($site_name) . '" />';
if($image) echo '<meta property="og:image" content="' . esc_url($image) . '" />';
// Twitter Card
    echo '<meta name="twitter:card" content="summary" />';
    echo '<meta name="twitter:site" content="@yourtwitterhandle" />';
    echo '<meta name="twitter:creator" content="@yourtwitterhandle" />';
    echo '<meta name="twitter:title" content="' . esc_attr($title) . ' | ' . esc_attr($site_name) . '" />';
    echo '<meta name="twitter:description" content="' . esc_attr($description) . '" />';
      echo '<meta name="twitter:image" content="' . esc_attr($image) . '" />';
  }
}

You can use yoast plugin. It fixed the same issue for me. Once installed, you can visit its options: Social-> Facebook, there you need to set the image. After setting the default image yous issue will be fixed.

Related