Does X (Twitter) Work in China? Blocked Embeds, widgets.js & ICP
X (formerly Twitter) is blocked by the Great Firewall in mainland China, so an embedded X Post — which loads widgets.js from platform.x.com — fails and can break your China-facing page. There is no compliant way to unblock it; the fix is to remove the blocked embed and deliver your own site from an ICP-filed, in-country path. A compliance-first look.
Does X (formerly Twitter) work in China?
Whether X — the platform formerly called Twitter — works in China is a reachability question with a blunt answer: X is blocked by the Great Firewall, and there is no compliant way to make it load inside the mainland. 21YunBox does not route mainland visitors around that block, and would not — the honest fix is to stop depending on a blocked host, not to tunnel to it.
What usually breaks a real site is narrower than x.com itself: the embedded X Post you added with X for Websites. That embed is markup you generate at publish.x.com plus a loader script, widgets.js, that the browser fetches from platform.x.com — an X-operated host. Inside the mainland that host doesn't answer, so the script never arrives, the markup never becomes a Post, and scripts waiting on it can hold up the page around it. The compliant path is to remove or gracefully degrade that blocked dependency and serve your own site from an ICP-filed, in-country path. The table below separates what's blocked from what you can actually fix.
This is a delivery-and-licensing picture, not a verdict — what applies depends on whether your site is public-facing in the mainland and how the Post is embedded. Our China team can map an in-country path with you →
What X's own documentation says about China
| Fact | Primary source |
|---|---|
An embedded X Post loads its script from platform.x.com. X's setup guide for X for Websites says to "include the widgets.js script in your template," and the asynchronous loader snippet it provides sets js.src = "https://platform.x.com/widgets.js" — an X-operated host, the same company mainland China blocks. Any page with an X embed therefore depends on reaching an X host to render the Post. | X Developer Platform — Set up X for Websites, retrieved 2026-10-08 |
An embedded Post is just markup until widgets.js renders it. X's JavaScript docs state that "widgets-js will find markup in a page and convert basic, functional mark-up into rich interactive widgets." The markup you generate at publish.x.com only becomes a Post after the browser fetches that script from platform.x.com — so when the host can't be reached from inside the mainland, the embed never renders. | X Developer Platform — JavaScript Interfaces for X for Websites, retrieved 2026-10-08 |
X recommends loading widgets.js once per page "for best performance and reliability" — which also makes it a single point of failure in China. The guide tells authors to "Include the X for Websites JavaScript once in your page template for optimal web page performance." Inside the mainland, that one shared dependency is exactly what fails: with platform.x.com unreachable, every X embed on the page is left waiting on a script that never arrives. | X Developer Platform — Set up X for Websites, retrieved 2026-10-08 |
| Your own public site still needs an ICP filing — that duty doesn't go away with the embed. A website served to mainland visitors from inside China turns on an ICP filing (ICP 备案) under State Council Order No. 292 and MIIT's filing measures, tied to a hosting resource physically located in the mainland. Removing a broken X embed fixes the Post; it does not, on its own, give a China-facing site the in-country, ICP-filed footing it needs to operate lawfully. | State Council Order No. 292, Article 4 (Measures for the Administration of Internet Information Services) |
Sources verified by the 21YunBox compliance team on 2026-10-08.
For a mainland-China audience, the question about X — the platform most people still think of as Twitter — has a blunt answer before performance ever enters the picture: X is blocked by the Great Firewall, and there is no compliant way to make it load inside the mainland. What trips up most teams, though, isn’t x.com itself; it’s the X Post they embedded. An embedded Post is a snippet of markup plus a loader script the browser has to fetch from an X-operated host, and when that host can’t be reached, the Post is a blank gap and the page around it can hang. The fix is not to tunnel to a blocked platform; it is to stop depending on it, and to put your own site on compliant, in-country footing.
js.src = "https://platform.x.com/widgets.js"; — platform.x.com is an X-operated host the mainland blocks, which is why an embedded Post can't render from inside China. Source: docs.x.com/x-for-websites/javascript-api/guides/set-up-x-for-websitesX (formerly Twitter) in China at a glance
| What decides it | What it means for a China-facing page |
|---|---|
| Is it reachable? | No. X is blocked by the Great Firewall; x.com and the X-operated hosts its widgets use do not load from inside the mainland. This is a block on the destination, not a slow route. |
| Your embedded X Post | An X Post embed is markup generated at publish.x.com plus the widgets.js loader fetched from platform.x.com. Those X hosts are blocked, so the script never arrives and the Post can't render — a blank gap, and scripts waiting on it can stall the page. |
| Can it be unblocked? | Not compliantly. There is no lawful way to route mainland visitors around the Firewall to a blocked platform, and 21YunBox does not do it. The fix is to remove the dependency, not tunnel to it. |
| Your own site's license | A public site served to mainland visitors needs an ICP filing tied to in-country hosting — independent of whether the X embed is on the page. |
| The compliant fix | Remove or gracefully degrade the blocked embed and deliver your own site from an ICP-filed, in-country path — as an overlay on your current stack. |
Blocked at the destination, not slowed on the route
X’s problem in China is not latency; it is reachability. The Great Firewall blocks the service, so from inside the mainland x.com and the X-operated hosts its widgets rely on simply do not answer — not slowly, but at all. No amount of routing or caching on your side changes that, because the block sits on the destination, not on the path your page takes to reach it. That rebrand from Twitter to X changed the name and some of the hostnames; it did not change the status. The honest starting point rules out the entire “just make it faster” category of answers.
Why the X embed breaks your China-facing page
The damage most teams actually see is on their own pages, and it traces to how X for Websites works. An embedded Post is not a self-contained picture of a tweet — it is markup you generate at publish.x.com, plus a loader script, widgets.js, that the browser pulls from platform.x.com and that turns that markup into the rendered Post. X even recommends including that script once per page “for best performance and reliability.” Inside the mainland, that same shared dependency is the single point of failure: platform.x.com can’t be reached, the script never arrives, and the embed stays raw markup — a blank gap where the Post should be. Worse, layout and scripts that wait on the widget can delay the rest of the page, so one dead embed can make an otherwise working page look broken. Because it all renders normally outside China, this rarely gets logged as a bug — it just quietly costs you the mainland visitor.
Your own site still needs an ICP filing
Pulling the dead embed off the page fixes the Post, but it leaves a second, separate question untouched: is your site cleared to operate in the mainland at all? A public-facing website delivered to mainland visitors from inside China turns on an ICP filing (ICP 备案) under State Council Order No. 292 and MIIT’s filing measures, and that filing has to sit on a hosting resource physically located inside the mainland. That obligation attaches to your site, not to X — it stands whether the Post is embedded, replaced with a screenshot, or dropped entirely. Being reachable and being licensed to operate are two different bars, and which ones you must clear is a risk question for counsel, based on what you serve and who your users are.
The compliant fix — remove the blocked dependency, not tunnel to it
The durable fix follows from the diagnosis, and it is not to tunnel to X. 21YunBox does not route visitors around the Great Firewall to a blocked platform, and a public China-facing site should not depend on that working. Instead: remove or gracefully degrade the blocked X embed so the page renders cleanly without it, and deliver your own site from a compliant, in-country path. Each step replaces a dependency on a blocked X host with delivery that works lawfully inside China — the opposite of trying to sneak the blocked one through.
Where 21YunBox fits — a compliant overlay, not a migration
You keep building on the stack you already have. We add the part a blocked platform can’t give you: we help you replace or degrade the dead X embed and set up compliant, ICP-filed delivery of your own site from inside the mainland — in front of your existing origin, with no rebuild, no second codebase, and no attempt to route around the Firewall. Our China team maps your ICP obligations against your entity and what you serve, then stands up the in-country delivery a lawful China presence needs, while your application stays exactly where it runs today.
Related reading:
