Twitter embeds on Discourse forums have broken due to Twitter removing Open Graph tags from server-rendered pages, which affected the oneboxing functionality. Users reported that tweets were no longer previewing properly, showing only links instead of rich previews. The issue was traced to Twitter’s change in rendering, where Open Graph tags are now only added via client-side JavaScript. A workaround was found by using a specific user agent (DiscourseBot/1.0) to fetch the full metadata. This led to a fix in the Discourse onebox engine, with a commit merged to restore functionality. Some users initially faced issues with caching or configuration, but rebaking posts resolved the problem. The fix was confirmed to work on both custom forums and the meta site, with further updates expected from the team.
Hello, a few days ago on our Discourse fourm twitter embeds have borken, leading to issues of having to click every tweet and not being able to see a summary first.
They currently look like this
What is the issue if anyone knows and what is the fix?
Ah, it’s now working except for a few historic links. I’m assuming something has been cached by the forum, I’ll see if I can find a way to recache them.
I posted about this change in the Twitter forums, let’s see if anything useful comes up
I believe this change was to save rendering time on their servers, as the tags are now only filled by React during client render. This makes their HTML static, allowing they to adopt Architecture | web.dev, which makes webapps render a lot faster.
# standard call
➜ ~ curl https://twitter.com/TwitterSupport/status/1267105441278033920 -s | grep og:
<meta property="og:site_name" content="Twitter" />
# special user agent
➜ ~ curl https://twitter.com/TwitterSupport/status/1267105441278033920 -s -H "User-Agent: DiscourseBot/1.0" | grep og:
<meta property="og:type" content="article">
<meta property="og:url" content="https://twitter.com/TwitterSupport/status/1267105441278033920">
<meta property="og:title" content="Twitter Support on Twitter">
<meta property="og:image" content="https://pbs.twimg.com/profile_images/1266884366279471105/OTps6MBS_400x400.jpg">
<meta property="og:description" content="“To follow what’s happening in real time, tap the ✨ located at the top right of your Home timeline to change from seeing top Tweets to latest Tweets first.”">
<meta property="og:site_name" content="Twitter">