0

I have moved to SSL recently but lost all FB likes. I have seen other answers here, I.e. Lost all Likes while moving to HTTPS but don't know how to apply it. For example, in Simple Facebook Plugin I can see the code:

$fbmeta['og:url'] = esc_url($permalink);

How do I change that so that it gets the http version?

Community
  • 1
  • 1
greektranslator
  • 499
  • 1
  • 6
  • 19

1 Answers1

0

Case 1: Load mix content with help of plugin

Really Simple SSL plugin has “force change mixed content” which mean it kept forcing every link on the site to http…

Some Features that useful

  • The mixed content scan, which shows you what you have to do if you don't have the green lock yet

  • The option to enable HTTP Strict Transport Security

  • The option to configure your site for the HSTS preload list

  • Mixed Content Fixer for the back-end

  • More detailed feedback on the configuration page.

https://wordpress.org/plugins/really-simple-ssl/

Case 2: Manually Add Facebook Open Graph Meta Data into Your WordPress Theme

//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

function insert_fb_in_head() {
    global $post;
    if ( !is_singular()) //if it is not a post or a page
        return;
        echo '<meta property="fb:admins" content="YOUR USER ID"/>';
        echo '<meta property="og:title" content="' . get_the_title() . '"/>';
        echo '<meta property="og:type" content="article"/>';
        echo '<meta property="og:url" content="' . get_permalink() . '"/>';
        echo '<meta property="og:site_name" content="Your Site NAME Goes HERE"/>';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //replace this with a default image on your server or an image in your media library
        echo '<meta property="og:image" content="' . $default_image . '"/>';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';
    }
    echo "
";
}
add_action( 'wp_head', 'insert_fb_in_head', 5 );

Other Solution

First you have to change url Please check FB guide lines

https://developers.facebook.com/docs/plugins/faqs#faq_1149655968420144

You will need to instruct the facebook crawler to re-scrape your url for the changes to take effect:

https://developers.facebook.com/tools/debug/sharing

Vasim Shaikh
  • 4,485
  • 2
  • 23
  • 52