Twitter links no longer onebox in Discourse due to Twitter blocking OpenGraph access for non-browser clients and deprecating legacy API routes. A recent fix by @jancernik switches to Twitter’s v2 API, but it requires a paid-tier API key to function — which meta.discourse.org and hosted instances now use, restoring oneboxing there. Self-hosted instances without paid keys will likely see no resolution. An alternative is using native Twitter embeds via a theme component, which users confirm works in posts (though not always in the composer). Richie reported the issue, pmusaraj explained the technical causes, and Lilly and Richie confirmed fixes and workarounds. The situation reflects Twitter’s broader restrictions on third-party access, leaving unpaid users without reliable oneboxing.
Thanks for the report, there are multiple possible issues here.
First, I think Twitter blocked getting tweet info via OpenGraph outright for all non-browser consumers (like bots and crawlers etc.). Multiple people in our team can’t get tweet oneboxes in Whatsapp, Telegram and other apps since a couple of days ago.
We added a fix for this yesterday by @jancernikFIX: Use Twitter API v2 for oneboxes and restore OpenGraph fallback (… · discourse/discourse@24c9053 · GitHub – that switches our code to use Twitter’s v2 API, which is the only remaining avenue for getting oneboxes. In our testing it works, but only if the API key is from a paid tier. I just checked, and it looks like here on meta we’re using a free tier API key (we’re working on a fix) and likely why it doesn’t work on your instance.
Note that Jan’s PR added OpenGraph fallback, but as he was working on it, Twitter blocked access to that too. There’s a very good chance that will never work (and we’ll remove the fallback code).
The bottom line is: without paying Twitter for API access, oneboxes might never work. It’s a sad state of affairs.
I just updated the API keys used on meta, and rebuilt the OP. Tweets now are embedded correctly here (and for clients in our hosting). The issues raised by the OP still apply to self-hosters though.
One alternative option here is to load native Twitter embeds, see this theme component.