The Discourse Open Graph plugin, sponsored by Netwrix, allows administrators to programmatically override Open Graph, Twitter, title, and description meta tags for improved SEO and social sharing. It features a single setting — open_graph_overrides — where users can define URL-specific overrides for title and description, with fallbacks to default values if left blank gabriel. Users discuss extending this to topics, suggesting AI-generated summaries (e.g., from Discourse AI Topic Summary) could auto-populate metadata jimkleiber. gabriel agrees and proposes integrating AI summaries into topic metadata via a modifier hook. JacobParis suggests dynamic OG images via URL parameters (e.g., ?title=...&date=...) using templates like {{topic.author.username}}, enabling integration with external services like placid.app jimkleiber. Olle11 asks if this is already possible in core settings; gabriel clarifies that regex-level precision isn’t available natively. Use cases include enhancing category pages (e.g., UX category) or specific topics (e.g., this thread) for better social sharing and SEO gabriel. Olle11 praises the plugin’s potential and hopes it becomes a core or standard feature.
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
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
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?
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!