Cloudflare on Wordpress.com site isn't showing Twitter preview

A couple of months ago I enabled the Cloudflare integration on my Wordpress.com site I recently noticed that I no longer saw the preview images for my posts on Twitter, and went to https://cards-dev.twitter.com/validator to debug what was going wrong. Pasting in the URL <see above, can’t post URL> I see the error message ‘Unable to render Card preview’, and the log ’
ERROR: Fetching the page failed because it resulted in too many redirects.’

I had a conversation with Wordpress support, and they suggested it might be caused by Cloudflare (relevant parts of the chat transcript included below). I’ve tried their suggestion of enabling strict https, but that doesn’t seem to have fixed it. Any ideas on what else I can try? Thanks for any help!


WP Support: I wonder if it might be something Cloudflare’s doing on their end that isn’t being accounted for? Your plan doesn’t permit you to install plugins, so there’s nothing on your site that would be conflicting. With your permission, I’d like to temporarily switch your primary domain to the free *.wordpress.com one we give you and then run a test. Just to rule out any weirdness.

Me: Please do. And that’s a good point about the Cloudflare integration, that’s the only site configuration I’ve changed recently

WP Support: Yep, it’s Cloudflare. Put this URL into the card validator and it’ll work like a charm. Caches Considered Harmful for Machine Learning « Pete Warden's blog

Me: Do you have any recommendations for who to contact at Cloudflare?

WP Support: Unfortunately no, but posting on their forums or shooting them an email might get their attention. You might check your SSL settings and see if that does it. If it’s set to flexible, try setting it to full (strict).

Apologies, see above for URL should be to Caches Considered Harmful for Machine Learning « Pete Warden's blog

So, at a quick glance, your og:image and twitter:image are specifying https://petewarden.files.wordpress.com/2022/06/food_cache.jpg. Retrieving that URL contains this header:

access-control-allow-origin: https://petewarden.wordpress.com

But your site isn’t on that domain (that domain redirects to your own domain). So I think that’s why the image shows up when you use the wordpress domain, but not your own.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.