Support » Plugin: Facebook » Wrong image when clicking "Like" for homepage

  • I have the like button displaying on posts and it works correctly using the right image.

    I also have the like button “show on Home” ticked but it does not show on the home page so I put a like button at the top of my sidebar (using WordPress-front page displays latest posts). When you click “Like” it is displaying the proper homepage url and tagline but is using a random image!

    How do I control the image it uses for the homepage?


Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Niall Kennedy


    The plugin uses your post’s featured image for single page views. You can add an image to a homepage or archive view through the fb_meta_tags filter.

    Sorry I don’t really get it. I have my WP site set up as

    Settings/Reading/Front page displays/Your latest posts

    So the home page is not a page that you can set a featured image.

    Maybe I can edit the “fb_meta_tags filter”? But I don’t know where I would do that, is it in one of the editor php files? Which one? Thanks.

    Yes, I would like to know where I can find more information about the fb_meta_tags filter. This sounds very useful.

    Plugin Contributor Niall Kennedy


    Custom actions and filters are documented in the Facebook plugin readme

    I read through all the material you recommend in the link but I still don’t see any indication of where these filters are located. Are they in a php file in my wordpress? Do I find them somewhere on Facebook developer page?

    How do you edit any of them?

    Plugin Contributor Niall Kennedy


    Filters are hooks into WordPress code you can use to customize your own installation.

    I added a new forum sticky explaining WordPress filters with example code. Please let me know if this answers your questions.

    Hi Niall and thanks for the info, I tried doing what it says in the link in the functions.php file and cleared the cached a couple of times but it had no effect.

    Hi Niall I’ve been silently following this thread ‘cuz I have the same issue as zep101.
    I’ve placed had a filter, as u showed in the example, in my funtions.php file and I’ve set a “featured image” on one post to check if anything was changing with a negative feedback.

    I definitely can NOT force Facebook to choose the “featured image” thumbnail instead of the others shown in each post, very frustrating indeed!

    Hi frons, I finally cracked the code for me anyway and it might work for you:

    After much trial and error I think I have fixed the issue. I won’t bore you with all the details except to say that I disabled “Facebook open graph” in my plugin SEO by Yoast and I inserted:
    <meta property=’og:image’ content=’’/>
    just before the closing head tag in the NomNom header.php

    I am no longer receiving any errors and my like button is showing the correct image! So far so good.

    Maybe you don’t have the SEO plugin if not just try pasting the meta property above into your header.php file just above the </head> tag. (of course modify for your own image)

    Good luck!

    Thanks zep, I’ve tried also this way, but not luck at all 🙁

    Be sure that you’re clearing your cache if you are using a caching plugin to make sure its not working.

    In the end I managed to solve this bug.
    It was easier than I expected, and, as usual in these situations, you always look for the most difficult solutions forgetting the easiest one back.

    For some mysterious reason it seems that OGP only likes thumbnails which dimensions are the same or more than 200 pixels. The fact is that when you upload an image on WordPress and set it as thumbnail, it will be resized to, by WP defaults, 150×150 pixels.

    In my case, the easiest solution was running the Facebook debugger which in turn gave me the ultimate hint on what I was lacking.
    Actually (forgive my hilarious madness) I was definitely lacking in size.

    After running a scan, I got this message:

    Open Graph Warnings That Should Be Fixed

    Small og:image: All the images referenced by og:image should be at least 200px in both dimensions. Please check all the images with tag og:image in the given url and ensure that it meets the recommended specification.

    So I manually enlarged a random thumbnail of one of my previous posts to the actual 200×200 pixel size and tadadah!!! Size DOES matter!

    Facebook now shares the proper link and proper image also from WP homepage or single post without hacking any code. Hope this can be of any help to everybody has the same issue!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Wrong image when clicking "Like" for homepage’ is closed to new replies.