Twitter Cards have stopped working for my WordPress.com site

  • Author
    Posts
  • #1533277

    Hi,

    Twitter cards have stopped working for my wordpress.com hosted site within the last week or 2.

    The twitter account is this one. If you scroll down to posts from 11 Nov and earlier, you will see the ‘View Photo’ Twitter card link is present & operating properly.

    https://twitter.com/DublinLitter

    However, for posts after 11 Nov, that link stops appearing & the tweets revert to plain.

    No changes have been made to anything on my side.

    I compared the HTML source from a working blogpost and a non-working one, and they contain the same twitter markup.

    All attention gratefully received as I do not think I can solve the problem
    from this side.

    thanks & regards

    The blog I need help with is dublinlitterblog.com.

    The blog I need help with is dublinlitterblog.com.

    #1533403

    kraftbj
    Staff

    Hi,

    They’re mostly working (see https://cloudup.com/cVFoTj6GYSE ).

    What happened with the top tweet ( pointing to http://dublinlitterblog.com/2013/11/21/fingal-std8-nov-17-2013/ ) is that a Gallery was used to insert the picture, which we then use to tell Twitter to use the Gallery Twitter Card (which is the second tweet in the screenshot—highlighting the images).

    Twitter, though, requires 4 images to make a Gallery Twitter Card, so your latest tweet to your site isn’t producing a card. I checked this using Twitter’s validator at https://dev.twitter.com/docs/cards/validation/validator

    I’ll write this up to see if there’s a way we can default back to the standard card type when there isn’t four images present on a post with a gallery, but in the mean time, if you could remove the gallery from the latest post and insert just a singular picture, the card should start working again.

    Please let me know if you have any questions or need anything else. Cheers!

    #1533457

    Thanks Brandon.

    But nothing has changed. All my wordpress posts have always been of type ‘Gallery’. If the Gallery happened to contain only one picture, that was fine. Twitter cards of type Gallery rendered a single picture just fine (up until 10 days ago that is.)

    That said, I will try as you suggest re the Single image & report back.

    thanks & regards

    Regards

    #1533463

    kraftbj
    Staff

    We just pushed a fix out to not offer the gallery Twitter card option for cases like your’s. Once the caches empty out on our end and with Twitter, it’ll begin to work without a change on your part.

    We pushed enhancement to our Twitter cards around that time, offering a more varied assortment of Twitter Card options, not relying on Facebook-style tags, and some other improvements, which is why this developed at that time.

    If you have any questions or need anything else, please let me know.

    #1533583

    Brandon,

    OK, so just to be clear: I do *not* need to change single-image posts from type Gallery.

    When caches drain out etc, single image Tweets will start to work again, as type Gallery, without changes on my side.

    Is that understanding correct?

    thanks & regards.

    #1533589

    Hi Brandon

    I was hopeful that the issue would be resolved over the weekend just past, but it seems not so, sadly.

    Here is a newly created post, of type Image (not Gallery).
    http://dublinlitterblog.wordpress.com/2013/11/25/footpath-blocked-with-rubbish-hazardous-underfoot-says-submitter-upr-dominic-std7-nov-24-2013

    And here is the corresponding Tweet
    https://twitter.com/DublinLitter/statuses/404915415639273472

    As you can see, it’s still not presenting the image.

    Can you please advise ? We provide a non-commercial public service and are starting to receive some (mild) complaints about this problem now. The problem has existed for 2 weeks.

    thanks & regards

    #1533595

    kraftbj
    Staff

    I’m not sure the cause of this (as it may be on Twitter’s end), but Twitter’s validator is reporting that your domain isn’t approved for twitter cards. That’s not something on our end we can control; I’m not aware of why it would happen.

    Last week when we were testing this out before, it was responding as approved.

    You can apply to add them back at https://dev.twitter.com/docs/cards/validation/validator

    A screenshot of what I’m seeing: https://cloudup.com/cVgUSAi3rec

    I opened a thread on Twitter’s Twitter Cards support forums for some clarification: https://dev.twitter.com/discussions/23305

    We don’t record when any changes are made to the “primary domain” on your WordPress.com site. If you changed your primary domain, that could account for this as well.

    Thanks for your patience.

    #1533596

    Thank you Brandon.

    I see from your screenshot of the validator that its coming through as a request for ‘Summary’ card type.

    And indeed, if I muself select ‘Gallery’ in the twitter validator, it still comes back as type ‘Summary’ when I paste in the URL:
    http://dublinlitterblog.com/2013/11/25/footpath-blocked-with-rubbish-hazardous-underfoot-says-submitter-upr-dominic-std7-nov-24-2013/

    Does this perhaps indicate some compatibility problem with the Twitter markup that WordPress inserts into the posts ? I can’t get it to select type Gallery, no matter what.

    In the meantime I have applied to Twitter for authorization of card type Summary. However I really require the types Gallery, Photo, and Summary Large Image.

    thanks for your attention.

    #1533597

    ps. Just got this email response from Twitter:

    ————————
    Dear Dublin Litter Blog,
    We can make it work. Let us explain.

    The URL you provided for dublinlitterblog.com to use the summary card did not validate. Please make sure the page contains valid metadata, then reapply for a Twitter card.

    Thanks for your patience. See you soon!

    ————————

    This looks like further evidence that there is indeed some problem with the markup that WordPress inserts.

    #1533599

    kraftbj
    Staff

    The Twitter Gallery format requires four images (or more) images within a post. With less than that, it fails, which was our original problem.

    Originally, we assigned cards set as “Gallery” within WP to that Twitter Card because we read through their documentation ( https://dev.twitter.com/docs/cards/types/gallery-card ), which seemed to us to contradicted itself (it says “up to 4 different images” in the free-form text which we read as optional, while the chart below indicates that each of four images are required).

    In other words, the Gallery Twitter Card can’t be used for your posts unless there are four or more images, either directly inserted into the post or added via a WordPress gallery.

    Since the post only has the single image, it is being sent to Twitter requesting a Summary type to stay in line with their requirements.

    My apologies for overlooking at each card type requires approval.

    Thanks!

    #1533600

    kraftbj
    Staff

    Regarding the failed validation, can you ask them for more information, as there are no errors returned when I test it (except for the need for the domain to be approved). The only lacking attribute is reported as not required:

    https://cloudup.com/c5iPmR59x6u

    Thanks!

    #1533606

    Hi Brandon

    Reading that Twitter doc link you provided, I think we may be getting somewhere.

    Here’s the markup inserted by WordPress in a recent problem post

    dublinlitterblog.com/2013/11/25/footpath-blocked-with-rubbish-hazardous-underfoot-says-submitter-upr-dominic-std7-nov-24-2013/

    <meta name="twitter:site" content="@wordpressdotcom" />
    <meta name="twitter:image" content="http://dublinlitterblog.files.wordpress.com/2013/11/upr_dominic_st_d7_nov_24_2013.jpg?w=240" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:creator" content="@DublinLitter" />

    and here’s what Twitter requires for a Summary card:
    https://dev.twitter.com/docs/cards/types/summary-card

    twitter:title
    twitter:description

    plus a few more optional ones such as twitter:image.

    So it seems that the markup for a Summary card is not correct. title and description are not set.

    What do you think ?

    #1533607

    And another question, thanks. My WordPress posts are all of WordPress type Image. (except for the Gallery special cases).

    But they’re all coming out as Twitter card type Summary. As you can see in the meta tags in my previous comment.

    I’d like to use card type Photo or Summary Large Image instead. How do I go about making that happen ?

    Thanks.

    #1533608

    kraftbj
    Staff

    The twitter:title and twitter:description are also satisfied by og:title and og:description (which are the Open Graph tags spearheaded by Facebook, but accepted by Twitter). Notice the list of tags and a fair number have og fallbacks: https://dev.twitter.com/docs/cards/markup-reference

    Notice on the screenshot from before that the og:title and og:description are being used and marked as validated (green) on Twitter’s validator: https://cloudup.com/c5iPmR59x6u

    When a single image is inserted to a post, we generally do assign it the tag for a Twitter photo image.

    On your site, you’ve been inserting a single image as a gallery, which is what’s throwing a wrench in the works. If, when adding the image, you choose Add Media and insert the image directly (without inserting it as a Gallery), it will correctly assign the Photo tag.

    An example using the image from the post you mentioned: http://kraftsandbox.com/2013/11/25/photo-post/ will validate as a Photo like this: https://cloudup.com/c6sGx3yx8gl

    We try to intelligently determine what card type to assign based on what’s in the post, not only what type of post is selected, to have the highest rate of a validated Twitter card (our initial less-than-four gallery glitch withstanding).

    Cheers!

    #1533609

    OK I get that now, thanks. Pity, I thought we were onto something.

    So here is some more info that might be relevant.

    We use the WP REST API to create posts. We don’t do it manually.

    Here’s a sample upload command, with the OAuth token redacted.

    curl -v -F 'format=image' -F 'title=Important to always remember itsa minority. Good news -> Church St, D7. Nov 12 2013' -F 'content=With thanks to PL' -F 'status=schedule' -F 'date=2013-11-12T22:34+0000' -F 'tags=privatisation,good news' -F 'media[]=@file84361.jpg' -H 'Authorization: Bearer ************ ' https://public-api.wordpress.com/rest/v1/sites/dublinlitterblog.wordpress.com/posts/new

    And the ‘format=image’ option is used no matter what number of images were included in the ‘media[]’ option. We never used ‘format=gallery’.

    This system worked fine for both multiple pictures:
    http://dublinlitterblog.com/2013/11/20/6-pics-the-autumn-leaves-actually-help-a-bit-around-the-childrens-hospital-crumlin-d12-nov-17-2013/

    and for single pictures:
    http://dublinlitterblog.com/2013/11/15/bag-of-bottles-there-for-a-few-days-says-submitter-harolds-cross-cottages-d6-nov-15-2013/

    I’m not sure whether, internally, either or both of these 2 are a Gallery.
    What I do know is that they all appear as type Image on the Posts page:
    http://postimg.org/image/tg7l5s61d/

    You’ll see the ‘Image’ hover-over and the icon type also seems to indicate a post type of Image. There’s a different icon for Gallery.

    So to sum up.
    – There are 3 reasons why I believed all our historic WP posts are of type Image. Maybe i’m mistaken.
    – Can you spot anything amiss with our usage above of the WP REST API ?
    – It will certainly move things forward if Twitter would start accepting content from the site again. However, I can’t view that link to the Twitter ticket that you supplied above.

    Thanks !

    #1533610

    kraftbj
    Staff

    Quick first response: There is a different between a Gallery post format (which you’re not using, as you’re using the image format) and using a Gallery within your post. (I realized how confusing it is to have a feature able to be inserted in any post named the same as a specific post format).

    In your case, you are inserting a gallery into the post. For the example of the single image post you linked to, here’s the text view of that post from within the web editor: https://cloudup.com/cZaocVyWmqd

    Here’s what it would look like if an image is uploaded individually: https://cloudup.com/cl9GCS2B0Hc

    That code difference is what’s triggering either a Gallery/Summary Twitter card (depending on if there are 4 or more images or not) and the Photo type.

    Let me do a couple of things:

    1. I’ll check with the developer that worked on the Twitter integration on getting a post with a single image in the way you’ve done it to fire a photo card. The code is already set to do that, so going to work with him on determining why it’s not firing it when a single image is wrapped as a gallery.
    2. Check with another dev re the REST API. With my knowledge of the API, you’re doing it the right way, but I don’t work with it day-to-day. It may be something on our end we can change or perhaps a different API command that isn’t documented (yet).

    Thanks for your patience and for sticking with us :-)

    Cheers!

    #1533611

    Brandon you are providing very fine support & I have no problem being patient as long we’re making good progress through the issue!

    Please do let me know what the other developers come back with. Thanks.

    #1533612

    kraftbj
    Staff

    On the REST API front—you’re doing everything correctly there. We do wrap all images in a gallery, mostly because it was the simplest implementation that, until now, hasn’t had a reason for anyone to question it :-).

    On the our internal Twitter implementation, the team is going to look at it with fresh eyes and see if we can make our various pieces of code play nicely with each other since, looking at each, it should be doing what we are wanting, but obviously something is amiss.

    Thanks again!

    #1533614

    kraftbj
    Staff

    We deployed a fix that makes everything right in the world.

    Here’s an example of what you’ll see soon: https://cloudup.com/cDdBqkC5Coi

    Twitter, from my understanding, does cache what they pull from your site for about a week, so the various tweets that have had issues may still show negatively until the cache cycles, but all new posts will work as we expect starting now.

    Cheers!

    #1533617

    Brandon, that’s great to hear.
    Thanks to you & the other developers for all your efforts.

    So a couple of final follow-up questions if you don’t mind :
    Q1. Will single image posts always come out as type Photo, or is there a method to opt for Summary or Summary-Large-Image instead if I feel like it ?

    Q2. Suppose I upload a post with 4 or more embedded images, and mark the post type as Image, not Gallery, in the REST call. (i.e. the old way).

    Will that continue to operate successfully?

    Here’s a sample of what I mean:
    http://dublinlitterblog.com/2013/11/25/6-picstaken-sundayfrom-just-one-small-part-of-d12-childrens-hospital-nearby-crumlin-d12-nov-24-2013/

    and its corresponding Tweet:
    https://twitter.com/DublinLitter/statuses/405113512823099392

    thanks.

The topic ‘Twitter Cards have stopped working for my WordPress.com site’ is closed to new replies.