# Discourse Open Graph

**URL:** https://meta.discourse.org/t/discourse-open-graph/363183
**Category:** Plugin
**Tags:** experimental
**Created:** [April 23, 2025, 4:57pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183 "2025-04-23T16:57:21Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [April 23, 2025, 4:57pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/1 "2025-04-23T16:57:21Z")

</div>

> Sponsored by [Netwrix](https://www.netwrix.com/)

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Update your Open Graph data programmatically and enhance your SEO |
| 🛠 | **Repository Link** | [GitHub - discourse/discourse-open-graph · GitHub](https://github.com/discourse/discourse-open-graph) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### Features

This plugin lets you override your Open Graph, Twitter, title, and description tags.

### Configuration

This plugin ships with only one setting: `Open graph overrides`, which opens to this modal:

 ![The image shows an "Edit open_graph_overrides" page with fields to configure the URL, title, and description for Open Graph meta tags, featuring buttons for new items and saving changes. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/8/f/88f6b1032a230ecbcb1ea59ef33d3449c65ff680.png)

You have a `URL` property, which will match and use it to override your meta tags – this will be your ID.

`Title` - Will override the `title`, `og:title`, and `twitter:title` tags. If empty, it will default to the original value.

`Description`- Will override the `description`, `og:description`, and `twitter:description` tags. If empty, it will default to the original value.

### Settings

Include a table of settings and setting descriptions

| Name | Description |
| --- | --- |
| discourse\_open\_graph\_enabled | Enables open graph plugin |
| open\_graph\_overrides | Editor for your overrides |

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 26, 2025, 8:04pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/2 "2025-04-26T20:04:07Z")

</div>

I’m really excited this exists. The thought I just had tho was: does this work for topics?

I assume no, because then one might have to manually type in open graph info for each topic.

Then I thought: what if the topic description were autogenerated by Discourse AI summarizing the topic?

Maybe using [Discourse AI Topic Summary 🤖](https://meta.discourse.org/t/discourse-ai-topic-summary/256711)

The title could be the same and description the AI summary. And maybe tweakable if people want to edit it, similar to on Wordpress with Yoast.

Any thoughts on this?

---

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [April 28, 2025, 2:51pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/3 "2025-04-28T14:51:18Z")

</div>

> [@jimkleiber](#):
>
> does this work for topics?

I think it does! But it would be necessary to add an override for every topic.

Maybe this could be a feature for AI Topic Summary–it could override the metadata content based if they had the ai summary in the topic itself.

Some pseudo-code, [inspired by this snippet in the Open Graph plugin](https://github.com/discourse/discourse-open-graph/blob/e9a0c5179c260236caf106d9875ad46c9e2e531d/plugin.rb#L21-L29):

```rb
  register_modifier(:meta_data_content) do |content, property, opts|
    next content if property == :url # we don't want to override the url
    url = opts[:url]
    override = Topic.find_by_url(url)[:ai_meta_data_override]
    if override
      content = override[property] if override[property] # it can be either :title or :description
    end
    content
  end

```

---

<div class="post-metadata">

### Author: ![JacobParis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jacobparis/32/501451_2.png) [@JacobParis](https://meta.discourse.org/u/JacobParis)
#### Post date: [May 1, 2025, 7:41pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/4 "2025-05-01T19:41:42Z")

</div>

There doesn’t need to be any AI built in here – all you need for dynamic OG images is to be able to pass parameters from the topic into the URL like `?title=Hello+World&date=2025-04-27`

This could be a template system like `{{topic.author.username}}` or whatever you think makes sense here

That will let the user plug into any existing service that generates OG images, or connect to one of their own, or to a future offering by Discourse if you want first class support

---

<div class="post-metadata">

### Author: ![Olle11](https://avatars.discourse-cdn.com/v4/letter/o/cdc98d/32.png) [@Olle11](https://meta.discourse.org/u/Olle11)
#### Post date: [May 3, 2025, 4:01pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/5 "2025-05-03T16:01:09Z")

</div>

As someone who is fairly new to Discourse; cant this already be done in the Discourse settings?

---

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [May 3, 2025, 4:09pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/6 "2025-05-03T16:09:40Z")

</div>

With this precision(regexing) no.

And eventually we could add images dinamically

---

<div class="post-metadata">

### Author: ![Olle11](https://avatars.discourse-cdn.com/v4/letter/o/cdc98d/32.png) [@Olle11](https://meta.discourse.org/u/Olle11)
#### Post date: [May 3, 2025, 7:19pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/7 "2025-05-03T19:19:53Z")

</div>

Oh ok would you mind giving me a use case when you would like to override the settings? Is it when you are sharing a link from your forum, for example a topic that it will then look different or mainly for SEO concerns?

---

<div class="post-metadata">

### Author: ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)
#### Post date: [May 3, 2025, 7:21pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/8 "2025-05-03T19:21:41Z")

</div>

Sure! One very good example is the category list page:

> **[UX](https://meta.discourse.org/c/contribute/ux/9)**
>
> UX topics are used for when Discourse technically works as intended, but the design, interaction, or flow creates unnecessary friction, confusion, or inefficiency for users. Also for small “quality of life” improvements. completed or fixed tags are applied depending on the nature of the topic.

We can override both title and description to be more descriptive

Or for very specific topics that you want to have a different text when sharing in social media:

> [@Discourse Open Graph](https://meta.discourse.org/t/discourse-open-graph/363183):
>
> Sponsored by [Netwrix](https://www.netwrix.com/)information_sourceSummary Update your Open Graph data programmatically and enhance your SEOhammer_and_wrenchRepository Link [GitHub - discourse/discourse-open-graph · GitHub](https://github.com/discourse/discourse-open-graph)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)Features This plugin lets you override your Open Graph, Twitter, title, and description tags. Configuration This plugin ships with only one setting: Open graph overrides, which opens to this modal:

We could change to be just the title and some kind of small description

---

<div class="post-metadata">

### Author: ![Olle11](https://avatars.discourse-cdn.com/v4/letter/o/cdc98d/32.png) [@Olle11](https://meta.discourse.org/u/Olle11)
#### Post date: [May 4, 2025, 12:28am UTC](https://meta.discourse.org/t/discourse-open-graph/363183/9 "2025-05-04T00:28:49Z")

</div>

That is very cool. I know some companies have some impressive dynamically added images to open graph to make it more enticing. I hope this feature gets added to Discourse core or as a standard plugin. Great work!

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [June 29, 2025, 2:47pm UTC](https://meta.discourse.org/t/discourse-open-graph/363183/10 "2025-06-29T14:47:52Z")

</div>

> [@JacobParis](#):
>
> There doesn’t need to be any AI built in here – all you need for dynamic OG images is to be able to pass parameters from the topic into the URL like `?title=Hello+World&date=2025-04-27`

Yes, I’d love this to plug it into the placid.app service that I use and have it return the image that then gets used.

Maybe I’ll play with it when I have some free time.
