Jump to content

Unrelated question to PW - it's a problem with Twitter


Recommended Posts

I don't want to share a link here (it is my signature), but I have a problem: when sharing a link on Twitter (X), it doesn't pull images anymore. The problem started "recently," and I can't replicate it. I rewrote the code, removed it, and placed it again, cleared the cache every time, tried with meta twitter:image:src, had a look at the cpanel (no IP blocked), read about 100 websites, and I am completely powerless. I hoped someone here could help me.

I got the following error when using the Twitter Card Validator:

ERROR: Failed to fetch page due to: HttpConnectionTimeout


Link to comment
Share on other sites

The official Twitter Card Validator tool no longer functions and renders a preview, why they didn't just remove the tool is unknown to me. Instead, they direct devs to just start creating an actual tweet (no need to send it) to test rendering/preview functionality. I get the same error with my website using the Twitter Card Validator, but it renders as expected when writing out a tweet.

What's the difference between your site and mine that I tested against?

Your HTML is minified. Maybe that has something to do with it? I'm not sure.

Link to comment
Share on other sites

@BrendonKozthanks for helping me!!!

I've tried the non-minimized version (it worked before as-is). I even changed the brackets at the end from "/>" to ">" and back. It's incredibly frustrating because I have no idea what to do, and I'm not server-oriented enough to test it from that side, like ports. I believe I've missed something, but I can't see it.

Link to comment
Share on other sites

I didn't see anything in particular that looked out of place from quickly looking it over either. In fact, the unofficial Twitter Card Validator rendered a Twitter card as you'd expect from your markup. Usually if something changes without you doing anything, the fault isn't on your end - or at least with your code (maybe, like you said, a change to the server, like a robots.txt file or some sort of proxy, server protection, redirection, etc.). Since Twitter's official validator/renderer isn't really active anymore, it's hard to know what isn't working and why.

If you have a different server (host) and web domain that you could test against, maybe export the source code of your homepage, along with the image (and path) and recreate it elsewhere and see if linking to that test/temporary location works as expected. At the very least - if it works - it would eliminate the rendered HTML code as being the issue.

Link to comment
Share on other sites

I just ran your home page's minified HTML source through a code beautifier so I could read it a bit better, removed all IMG elements, CSS link and JS references, and uploaded it to a subdomain of our hosted website. I tested linking to the "test.html" file via Twitter and it did not unfurl to create a card.

I then noticed that you're declaring both Facebook Graph and Twitter Card meta tags. I have not done that; I've used Facebook Graph meta tags, and only added the Twitter Card meta tags that don't also exist under Facebook Graph, so I removed all of your Twitter meta tags except "card" and "site", and tried it again. This time it loaded up a preview card. The image didn't load, but it may be because the domains don't match (I'm not sure about that one).

This is what I used:

<meta property="og:title" content="Digital Marketing Montenegro: SEO &amp; Online Marketing Expert">
<meta property="og:description" content="Digital Marketing Montenegro. Top SEO &amp; SEM Services for Brands. Increase Website Traffic &amp; Leads. Get a Free Quote from Miljan Vujosevic Today!">
<meta property="og:type" content="website">
<meta property="og:image" content="https://vujosevic.com/site/assets/files/1/web-1.1200x630.jpg">
<meta property="og:url" content="https://vujosevic.com/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@VujosevicCom">

I'm not saying that will fix everything (as when I tried it the image didn't render), but it at least did get a card view to show up!

Link to comment
Share on other sites

Posted (edited)

@BrendonKozNo. The Validator validated every 10th time. Once, the tweet pulled the full image. Once, it created space but an empty image. Several times, it created a thumbnail with no image, too. I will try HTML and another server tomorrow first thing in the morning.

  1. I tried from the same server, another website in ProcessWire, and it worked. Not anymore. (edit)
  2. I tried with another CMS from another server; it was a different CMS, and it worked.
Edited by Leftfield
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...