How I fixed Twitter/X link previews not working with Cloudflare (It was pseudo IPv4)

For many months, I had a deeply annoying problem: links from my website simply would not reliably generate previews on Twitter/X.

No headline.
No image.
Just a bare URL.

This was happening only on Twitter/X. Facebook, LinkedIn, Slack, WhatsApp – all fine. Twitter/X alone refused to play ball.

If you are running your site behind Cloudflare, here is what finally fixed it for me – and it turned out to be an obscure IPv4-related setting I had never touched before. For what it’s worth, I was running Cloudflare in front of a SiteGround server.


The symptoms

  • Twitter/X showed no card preview at all
  • The flaky Twitter Card Validator either failed silently or hung while fetching the page
  • All Twitter Card and Open Graph meta tags were correct
  • Previews worked everywhere else

This ruled out broken meta tags, robots.txt issues, caching plugins, image dimensions, and HTTPS problems.


The real cause: Cloudflare’s Pseudo IPv4 setting

The issue turned out to be Cloudflare’s Pseudo IPv4 setting, which lives under Network.

This setting controls what happens when a client connects over IPv6 but still expects IPv4-style headers. Cloudflare can inject an IPv4 address into the request headers so older or more brittle systems do not break.

Twitter/X’s crawler appears to connect over IPv6 while still relying on IPv4-style headers. With Cloudflare’s Pseudo IPv4 setting disabled, the crawler did not successfully fetch my page, which explains why previews failed without any useful error message.


The fix (this worked instantly)

  1. Go to Cloudflare → Network
  2. Find Pseudo IPv4
  3. Change it from Off to Overwrite Headers
  4. Save

Within minutes Twitter previews started working reliably.


Why “overwrite headers” matters

Cloudflare offers two options:

  • Add Header – only adds an IPv4 header if one does not already exist
  • Overwrite Headers – forcibly replaces existing IP headers with IPv4-compatible ones

In my case, Overwrite Headers was the critical difference. Twitter/X’s crawler appears to be particularly sensitive to mixed or inconsistent IP headers, and this option removes that ambiguity.


Why this only breaks Twitter/X

This is what makes the issue so frustrating.

  • Facebook works
  • LinkedIn works
  • Slack works
  • Browsers work
  • Twitter/X does not

Twitter/X’s crawler seems to be brittle, relying on older networking assumptions, and provides almost no actionable error feedback. Cloudflare, meanwhile, increasingly defaults to IPv6-first behaviour, which is great in general but not always compatible with legacy bots.


TL;DR

If Twitter/X previews are not working and you use Cloudflare:

  • Your meta tags are probably fine
  • Your images are probably fine
  • Check Network → Pseudo IPv4
  • Set it to Overwrite Headers

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *