# Creating rich link previews with Onebox

**URL:** https://meta.discourse.org/t/creating-rich-link-previews-with-onebox/98088
**Category:** Using Discourse
**Tags:** onebox, how-to
**Created:** [September 26, 2018, 9:26am UTC](https://meta.discourse.org/t/creating-rich-link-previews-with-onebox/98088 "2018-09-26T09:26:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [September 26, 2018, 9:26am UTC](https://meta.discourse.org/t/creating-rich-link-previews-with-onebox/98088/1 "2018-09-26T09:26:52Z")

</div>

> 🔖 This is a guide for creating rich link previews with Onebox in Discourse. It explains how to create Oneboxes, use inline Oneboxing, avoid Oneboxing, use hyperlinks, and handle advanced iFrames.
> 
> 🙋 Required user level: All users

Onebox converts your web links into useful preview excerpts that help inform readers about the target _before_ they click through.

## Summary

This guide covers how to:

- Create Oneboxes
- Use inline Oneboxing
- Avoid Oneboxing
- Use hyperlinks instead of Oneboxing
- Handle advanced iFrames

## Creating a Onebox

To create a Onebox, simply paste any link into a post on a line by itself, like so:

```plaintext
https://www.google.com/

```

This results in:

> **[Google](https://www.google.com/)**
>
> Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.

Onebox supports general oEmbed and OpenGraph tags, and has custom rules for popular sites like Wikipedia, Twitter, Amazon, YouTube, and others.

Try pasting links into your posts and see what happens. Just remember that for Oneboxing to work, the link _must_ be on a line by itself!

## Inline Oneboxing

With the `enable inline onebox on all domains` site setting enabled (this feature is enabled by default), pasting the link inline with the text will replace the raw link with the title of the page, like this [Understanding Discourse Trust Levels](https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/)

> `like this https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/`

## Avoiding Oneboxes

If you want the link to show up as a plain, unadorned raw link, place it in `<` brackets `>`:

```plaintext
<https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/>

```

Alternatively, you can place a space before the link or any characters after the link.

## Using hyperlinks

You can add a link to your text by:

- Using the chain-link button in the editor toolbar
- Selecting some text in your post and pasting a link from your clipboard
- Adding Markdown / BBCode / HTML links:

```plaintext
[link here](https://example.com)
[link=https://example.com]link here[/link]
<a href="https://example.com">link here</a>

```

## Advanced iFrames

By default, `<iframe>` is blocked for security reasons. However, if the iframes are from highly trusted sources, a Discourse admin can add that domain to the `allowed iframes` site setting.

You may also need to paste the full embed code, such as the one for the map below:

```plaintext
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d24202.451099423397!2d-74.06201522657554!3d40.68924937923285!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25090129c363d%3A0x40c6a5770d25022b!2sStatue+of+Liberty+National+Monument!5e0!3m2!1sen!2suk!4v1533203877892" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

```

This results in:

https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d24202.451099423397!2d-74.06201522657554!3d40.68924937923285!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25090129c363d%3A0x40c6a5770d25022b!2sStatue+of+Liberty+National+Monument!5e0!3m2!1sen!2suk!4v1533203877892
## Additional resources

For further information and troubleshooting Oneboxes, please visit the related topic below:

> [@Configuring and troubleshooting oneboxes](https://meta.discourse.org/t/onebox-configuration-and-troubleshooting/239715):
>
> bookmark This guide explains how to configure and troubleshoot oneboxes in Discourse. It covers admin settings, how oneboxes work, and steps to resolve common issues. person_raising_hand Required user level: Administrator Oneboxes are rich link previews that users can create in their posts. While users can easily generate these previews, site administrators have additional controls and may need to troubleshoot when links don’t preview as expected. Admin configuration To manage onebox s…

> Last edited by @hugh 2024-06-27T00:43:25Z
> 
> Last checked by @hugh 2024-08-08T01:48:19Z
> 
> > **Check document**
> >
> > Perform check on document:
