Disable link previews?

Is there a way to globally disable link previews? They aren’t useful and often lead to an incorrect auto-generated title.

I see some previous threads on the topic, like:

This is especially an issue for us when I try to paste multiple links to the same site but with different anchor bookmarks (like page#section1, page#section2) etc.

I see in one of the threads there is an option to disable something called a “onebox”. I’m not sure what that means; is that the same thing as a link preview? Is there any side effect from disabling that altogether (max one box per post = 0), or would it affect other “oneboxes” elsewhere in the site too?

1 Like

yes

also yes, there are special cases like youtube that embed the media directly rather than providing a link preview (various special cases are listed discourse/spec/fixtures/onebox at f5cbc3e3b8a58132fc835aeab4d2275719ebe8ab · discourse/discourse · GitHub… so also Amazon, Instagram, Spotify, Twitter, etc)

If ultimately you want the behavior to be “just show the link” without previews or embeds of any kind, then you can set that setting to 0.

There’s also a more specific setting, blocked onebox domains, that you can add domains to if there are only a small number not providing useful previews.

Also note that once disabled, it won’t be applied retroactively on existing posts, the HTML of the posts with the oneboxes will need to be rebuilt. That can be done via the rails console: Rebake all posts? - #2 by zogstrip

5 Likes

Thank you so much for the helpful details, @awesomerobot! I’ll tinker with those settings.