• Resolved yeuci

    (@yeuci)


    Hey so is there a way to make it so my posts don’t include any images? (oEmbed images)
    I only want my pages to show the featured image on them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    You can unset the oEmbed image by implementing this filter:

    add_filter( 'oembed_response_data', function( $data ) {
    	unset( $data['thumbnail_url'], $data['thumbnail_width'], $data['thumbnail_height'] );
    	return $data;
    } );

    I’m not sure why you want this implemented. Do you have a concrete example of undesired sharing behavior (with a link)?

    For TSF, you can restrict the number of images via its social meta settings; the toggle is called “Output multiple Open Graph image tags?”. This option doesn’t affect embeds, however; only Open Graph.

    • This reply was modified 5 years, 11 months ago by Sybre Waaijer. Reason: clarity

    Sybre, question, and comment on this…

    Each day I post news on our site, but do not always add a featured image to a post. Our posts are then automatically added to our Twitter/Facebook account where the same fallback image appears every time. Only when I add a featured image to the post does it change. No-fault of your software by the way.

    To social media users though, I am sure many scroll right past the posts with the same share image. Its human nature.

    How can we configure TSF to not display an image on posts unless the post has a featured image? Maybe just display the link with the favicon next to the link instead. I tried the code above, but it still seems to be outputting our fallback image… Thanks sir.

    • This reply was modified 5 years, 11 months ago by bward.
    • This reply was modified 5 years, 11 months ago by bward. Reason: Clarity
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @bward

    I think it’d be best to open a new topic for this. I got an answer ready for you there!
    https://tsf.fyi/support/tsf/new-topic

    Ah! Sorry about that, I did that here. I should have opened a new thread, trying to kill two birds with one stone explaining why someone would want to implement that. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘oEmbed image restrict’ is closed to new replies.