Make WordPress Core

Opened 2 years ago

Last modified 6 days ago

#59142 reopened enhancement

X/Twitter posts cannot be embedded

Reported by: aphandersen's profile aphandersen Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch
Focuses: Cc:

Description

When a link to a Tweet/X post is copied in the Twitter/X app (iPhone), it is the x.com address that is copied, not the twitter.com address. When this is inserted in a WordPress post, the post is not embedded, like a Twitter.com post.

Change History (26)

#1 @swissspidy
2 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.4
  • Type changed from defect (bug) to enhancement

#2 @sukanta7660
2 years ago

  • Keywords dev-feedback has-patch added; needs-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

Users of X.com are now being forwarded to the Twitter website recently. The functionality for sharing and viewing content via URLs like "https://x.com/example/" is available, but it has not yet been completely implemented. This redirection, which links the x.com domain to Twitter's services, might be a part of a larger branding or domain plan. It is unknown if Twitter intends to incorporate the full functionality of sharing and viewing posts under this domain in the future. The most accurate and up-to-date information about this scenario would be found by keeping a watch on official announcements from Twitter or x.com because online developments are dynamic.

#3 @johnbillion
2 years ago

  • Keywords dev-feedback has-patch removed
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version 6.3 deleted

I'm going to reopen this for visibility during the 6.4 release cycle. There might not be anything to action for now but let's keep an eye on it.

#4 @swissspidy
2 years ago

  • Summary changed from X/Twitter posts cannot be embeddet to X/Twitter posts cannot be embedded

#5 @oglekler
2 years ago

  • Milestone changed from 6.4 to 6.5

Right now it still cannot be embedded, but due to redirect from X to Twitter nothing needs to be done yet. We are in 6 days before Beta 1, so, I am moving this ticket to the next milestone.

#6 follow-up: @brookedot
2 years ago

Noting there is also an issue in the Gutenberg repo on GitHub for the Twitter Embed Block:
https://github.com/WordPress/gutenberg/issues/54042

#7 in reply to: ↑ 6 @carlosgprim
2 years ago

Noting there is also an issue in the Gutenberg repo on GitHub for the Twitter Embed Block:
https://github.com/WordPress/gutenberg/issues/54042

As a workaround, until X embed URLs are supported in the oEmbed API, the Gutenberg Embed block will fall back to the Twitter provider when embedding X URLs (PR reference).

This ticket was mentioned in PR #5524 on WordPress/wordpress-develop by arthur-lextenso.


2 years ago
#8

  • Keywords has-patch added

Add tweet's embedding for x.com links which is the new domain name when somebody use "Copy tweet link" function on X.

arthur-lextenso commented on PR #5524:


2 years ago
#9

Not working : publish.twitter.com/oembed does not handle x.com links...
I close.

#10 @swissspidy
22 months ago

  • Milestone changed from 6.5 to 6.6

#11 @oglekler
19 months ago

@aphandersen can you test it again? Perhaps now is the time. Thank you!

#12 @peterwilsoncc
19 months ago

I've tested the oembed endpoint and it now supports x.com links but the systems remain a little messy.

The URL https://publish.twitter.com/oembed?url=https://x.com/elonmusk/status/1791351500217754008 returns an embed for the post on twitter.com.

The URL https://publish.x.com/oembed?url=https://x.com/elonmusk/status/1791351500217754008 still redirects to publish.twitter.com version.

I presume at some point publish.twitter.com will redirect to publish.x.com and I am wondering if it would be safer to wait x.com to use and x.com endpoint.

I think it really depends on how various browsers handle the eventual JavaScript redirect that will be added to the widget.js code.

This ticket was mentioned in Slack in #core by nhrrob. View the logs.


19 months ago

#14 @nhrrob
19 months ago

We have reviewed this ticket in today's bug scrub.
Looks like it won't make it to 6.6

@peterwilsoncc do you think we should punt or keep it in the milestone?

Thank you

#15 @audrasjb
19 months ago

  • Milestone changed from 6.6 to 6.7

Moving to 6.7 as this is still not ready to ship yet.

#16 @peterwilsoncc
19 months ago

Thanks for bumping, JB.

I think that WordPress should wait for X (formally Twitter) to get their server responses in order before accepting x.com links. Otherwise there is a risk that any presumptions WP makes will be incorrect.

@javiguembe commented on PR #5524:


19 months ago
#17

Hi!

Now x.com is active so IMHO this should be applied.

Thx!.

arthur-lextenso commented on PR #5524:


19 months ago
#18

Hi!

Now x.com is active so IMHO this should be applied.

Thx!.

Indeed, it seems to work now!

#19 @peterwilsoncc
17 months ago

I've repeated my once-per-release tests of Xitter's responses:

https://publish.x.com/oembed\?url\=https://x.com/WordPress/status/1819377181035745510
Redirects to
https://publish.twitter.com/oembed?url=https://x.com/WordPress/status/1819377181035745510
Which embeds the URL
https://platform.twitter.com/embed/Tweet.html...[snipped]

The embedded iframe links the source tweet as
https://twitter.com/WordPress/status/1818791285894844581?...[snipped query string]
which redirects to
https://x.com/WordPress/status/1818791285894844581?...[snipped query string]

tl;dr: X (formally Twitter) is still returning a mix of x.com (formally twitter.com) and twitter.com (now x.com) domains in their embed responses.

This makes it difficult to know what will happen in the future and how it will affect embeds created while their servers are in this state.

@swissspidy I can't decided:

a) whether these changes should go in or wait until X (formally Twitter) stabilizes their server responses to the new domain?
b) if the changes go in, is it best to refer to publish.x.com or publish.twitter.com?

What do you think?

#20 @swissspidy
17 months ago

Good question. This redirect mess is definitely not helpful. I'd say let's wait for this to stabilize.

I just tested embedding an x.com post and because of all these redirects I get a Twitter embed block as usual. So it still doesn't seem like an urgent change at the moment.

#21 @desrosj
16 months ago

  • Milestone changed from 6.7 to Future Release

I'm going to move this to Future Release until there's a bit more stability upstream. Please feel free to provide updates at regular intervals to help track any progress on the service that increases confidence in any related changes in WordPress.

This ticket was mentioned in Slack in #core-editor by fabiankaegy. View the logs.


11 months ago

#23 @peterwilsoncc
4 months ago

I've repeated my every now and then tests of Xitter's responses:

https://publish.x.com/oembed?url=https://x.com/WordPress/status/1961575391258112145

  • No longer redirects
  • Embeds the URL https://platform.twitter.com/embed/Tweet.html...[snipped]

The embedded iframe and fallback blockquote link to https://twitter.com/WordPress/status/1961575391258112145?...[snipped] as the source URL this redirects to https://x.com/WordPress/status/1961575391258112145?...[snipped]

The "copy link" button in the iframe copies a link to x.com.

It's less of a mess of the old and new domains but it's still a mess.

Last edited 4 months ago by peterwilsoncc (previous) (diff)

#24 @annezazu
3 weeks ago

Thanks for all the work done here to try to work around this. I have reached out to X using a contact we have through Automattic to see if we can raise awareness in order to get some traction or ideas on their end for how best to come up with a solution together for our shared users. I will keep this thread updated if/when I hear back.

#25 @annezazu
11 days ago

I have yet to hear back from my outreach but I was just informed that they should have fully migrated to x.com a few weeks ago per this news article that was shared with me: https://www.techradar.com/computing/twitter/x-set-to-put-a-stake-in-twitters-heart-as-it-kills-the-domain-and-possibly-wreaks-havoc-with-2fa-access

Reading this thread over, wouldn't this solve our problems here?

I ran some tests and the main oddness I noticed is that pasting an X post works but when I go to edit the URL, it shows the old twitter.com URL rather than x.com. I can manually change in the code editor and it works but when using the embed block we seem to be converting to twitter.com somewhere along the line.

#26 @peterwilsoncc
6 days ago

For future testing, when doing so you'll need to enable gutenberg and comment out these lines before building and testing. Or install the classic editor.

@annezazu I'm still seeing plenty of conflicting URLs when I do a request for the embed code. A request to https://publish.x.com/oembed?url=https://x.com/therepositorywp/status/1998769871581024731 returns the following HTML as the embed code:

<blockquote class="twitter-tweet">
  <p lang="en" dir="ltr">
    WordPress Playground’s 2025 Review Highlights Advances in Compatibility, 
    Performance, and Developer Tooling
    <a href="https://t.co/Dpp9C4uZcQ">https://t.co/Dpp9C4uZcQ</a> &mdash; The Repository (@therepositorywp) <a href="https://twitter.com/therepositorywp/status/1998769871581024731?ref_src=twsrc%5Etfw">December 10, 2025</a>
  </p>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

The resulting iframe created by the javascript is from https://platform.twitter.com/embed/Tweet.html

So it looks like they're still returning a mix of domains and there still isn't a source of truth.

Note: See TracTickets for help on using tickets.