Disable link previews?

AI-generated summary

In a support thread titled “Disable link previews?”, unknown_error asks if it’s possible to globally disable link previews, which they find unhelpful—especially when pasting multiple links to the same page with different anchors. They reference older threads and ask whether disabling “onebox” (a term they’re unfamiliar with) is equivalent to disabling link previews, and whether it has side effects. awesomerobot confirms that “onebox” is indeed the system responsible for link previews and embeds, and warns that disabling it entirely (by setting “max one box per post = 0”) will also prevent media embeds from services like YouTube, Instagram, Spotify, Twitter, and Amazon. They suggest using the “blocked onebox domains” setting as a more targeted alternative if only certain domains cause issues. Additionally, they note that disabling onebox won’t affect existing posts unless the HTML is manually rebuilt via the Rails console, referencing a guide for that process. unknown_error thanks awesomerobot for the detailed explanation and plans to experiment with the settings.

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?

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

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