# Set the image used for social network sharing?

**URL:** <https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880>\
**Category:** Support\
**Created:** [30 בינואר,‏ 2019,‏ 5:22am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880 "2019-01-30T05:22:57Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)\
**Post date:** [31 בינואר,‏ 2019,‏ 5:23am UTC](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880/23 "2019-01-31T05:23:37Z")

</div>

> [@codinghorror](#):
>
> when no image exists in the first post, go ahead and use the site logo

When working on adding this feature I caught a bug. I noticed that right now here is how we prioritize OpenGraph image: `first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url`.

And [https://discourse.codinghorror.com](https://discourse.codinghorror.com) did had the `site_apple_touch_icon_url` so the `twitter:image` tag was present `<meta name="twitter:image" content="/images/default-apple-touch-icon.png" />`.

Turns out Twitter [does not support relative image paths](https://stackoverflow.com/a/45941439). This is now fixed via:

[https://github.com/discourse/discourse/commit/f83533e1cb5ff262cb25d9392bc2dcc1621fb0ab](https://github.com/discourse/discourse/commit/f83533e1cb5ff262cb25d9392bc2dcc1621fb0ab)

Above commit also adds `logo_url` as last resort for OpenGraph/Twitter image tag. This updates opengraph image priority to: `first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url > logo_url`.

Verified the fix on [https://discourse.codinghorror.com](https://discourse.codinghorror.com):

 ![ch](https://global.discourse-cdn.com/meta/original/3X/e/c/ec9171aa9c428bc673de59a893b617ac11dd3731.png)

---

_[View the full topic](https://meta.discourse.org/t/set-the-image-used-for-social-network-sharing/107880)._
