Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    When you share a post on Facebook, or when Jetpack Publicize publishes a post to your Facebook page, Facebook crawls the page and looks for Open Graph meta tags in the head to build a complete post preview (with an image, title, description, …).

    Jetpack automatically creates these meta tags for you, and looks for images in your post in order to create an image meta tag.
    However, if you haven’t inserted any image, no image tag will be created and Facebook will then try to find another image at random on the page.

    There are 2 different ways to work around this issue:

    • You could add your logo as a Featured Image on those posts where you didn’t insert any image.
    • You could use the jetpack_images_get_images filter to add your own fallback logo when Jetpack cannot find an image to use in the post. To do so, try adding this code to your theme’s functions.php file, or in a functionality plugin:
      function jeherve_custom_image( $media, $post_id, $args ) {
          if ( empty( $media ) ) {
              $permalink = get_permalink( $post_id );
              $url = apply_filters( 'jetpack_photon_url', 'YOUR_LOGO_IMG_URL' );
      
              return array( array(
                  'type'  => 'image',
                  'from'  => 'custom_fallback',
                  'src'   => esc_url( $url ),
                  'href'  => $permalink,
              ) );
          }
      }
      add_filter( 'jetpack_images_get_images', 'jeherve_custom_image', 10, 3 );
    Thread Starter freedcomedy

    (@freedcomedy)

    That is the standard formula answer I’ve seen cut and paste dozens of times for others with this problem, but it doesn’t make sense. Look at that post in wordpress and in facebook. The image being published is nowhere in that post. In fact, the only image anywhere on that page is my headshot which would not be a bad alternative.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Here is the key information in my last reply:

    However, if you haven’t inserted any image, no image tag will be created and Facebook will then try to find another image at random on the page.

    Although you may not see the storefront image on that page, Facebook can as it scans for any images on the page. You can see what Facebook sees by entering the post URL in Facebook debugger:
    https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Ffreedcomedy.com%2Fbecause-im-fat%2F

    The storefront image is there, and Facebook grabs it from the “Upcoming Events” widget you’ve added to the footer of your site:
    http://i.wpne.ws/S6Bm

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatically posts inappropriate pictures to facebook’ is closed to new replies.