Support » Plugin: WordPress Share Buttons Plugin – AddThis » AddThis toolbar sharing og:title instead of twitter:title

  • Resolved thoughton

    (@thoughton)


    Hi,

    I’ve got an issue with the AddThis toolbar when sharing to twitter shares og:title instead of twitter:title.

    og:title and twitter:title are being generated by Yoast SEO.

    I had this problem on a site in development, and confirmed it on a default WordPress install with up-to-date AddThis and Yoast.

    Here is my test page: http://testing.thoughton.co.uk/_wp/yoast-addthis-test/

    You can see the correct og:title and twitter:title in the source, but if you try and share to twitter it will share og:title instead of twitter:title

    What am I doing wrong? Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author addthiskristin

    (@addthiskristin)

    Hi there!

    For Twitter Cards, Twitter scrapes the URL that’s being shared after it has been posted. Therefore, the title will not appear in the tweet preview, but will appear in the actual tweet once it goes into the Twitter feed.

    You can see what the tweet will look like using Twitter’s validator here: https://cards-dev.twitter.com/validator

    I have also tested this on my end and the title appeared correctly in my test tweet.

    Hope that helps! Let me know if you have any questions!

    thoughton

    (@thoughton)

    Hi Kristin, thanks for the reply.

    Unfortunately that doesn’t seem to be working for me.

    If I go to my test page http://testing.thoughton.co.uk/_wp/yoast-addthis-test/ and click the blue twitter icon in the AddThis toolbar, I get a popup window entitled “Share a link with your followers”. In the text box of this window it says “Yoast FB title http://testing.thoughton.co.uk/_wp/yoast-addthis-test/#.W5oxWPBdqEI.twitter

    If I click tweet this is what is tweeted. On my twitter timeline I see my own tweet about “Yoast FB title”. “Yoast FB title” is the og:title, not the twitter:title. I was expecting the tweet to be populated with “Yoast twitter title”, which is the twitter:title of this page.

    Please can you try it for yourself and see what is actually tweeted.

    Thanks!

    Edit: Please keep in mind I’m not talking about the twitter card. I’m talking about what goes in the actual tweet when a user clicks the blue twitter icon.

    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    Plugin Author addthiskristin

    (@addthiskristin)

    Hi there,

    When I tested sharing the page on Twitter, I was able to see “Yoast twitter title” appear as the title in my Twitter feed.

    When you share to Twitter via AddThis, we are passing the URL to Twitter and Twitter is controlling the share experience and the appearance of the tweet.

    Here is some information from Twitter on how to troubleshoot the Twitter card: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/troubleshooting-cards.html

    Let me know if you have any questions about that!

    thoughton

    (@thoughton)

    Hi Kristin,

    Unfortunately what you’re saying doesn’t match my experience.

    If I go to http://testing.thoughton.co.uk/_wp/yoast-addthis-test/ and click the AddThis twitter icon it pops up a small window which contains the words “Yoast FB title”. If I then click the tweet button it tweets out “Yoast FB title”.

    Here is a screenshot: https://imgur.com/a/0IE9ADQ

    I have tested in Safari, Chrome, Firefox. Same results in all of them.

    Any suggestions appreciated.

    Plugin Author addthiskristin

    (@addthiskristin)

    Hi there,

    Since this experience is controlled by Twitter and is not something that AddThis can change, I recommend checking out Twitter’s documentation:

    https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/troubleshooting-cards.html

    Or running the URL through Twitter’s debugger: https://cards-dev.twitter.com/validator

    If you continue to experience issues, I recommend contacting Twitter’s Support.

    Let me know if there is anything else I can help with!

    thoughton

    (@thoughton)

    Hello Kristin,

    So you are saying that this is a Twitter bug, and not an AddThis bug? You are saying that Twitter is scanning the page source code, and grabbing the og:description (instead of twitter:description!!!!!!). Forgive me, but this sounds extremely unlikely.

    Please stop giving me the Twitter Card troubleshooting link. As already explained twice above the bug I am referring to does NOT involve the Twitter Card in any way.

    The Twitter Card works. Please stop bringing it up. I am not in any way talking about the Twitter Card.

    I am starting to wonder if you are misunderstanding my issue. Is it possible to escalate this?

    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    • This reply was modified 1 year ago by  thoughton.
    thoughton

    (@thoughton)

    Hi again Kristin, maybe this will clarify things for you:

    As you can see the ‘Yoast FB Title’ is NOT part of the twitter card. This is what we are talking about. No one is talking about the twitter card except you.

    Plugin Author addthiskristin

    (@addthiskristin)

    Hi there,

    I apologize for misunderstanding your issue, thank you for providing the screenshot. Here is an article with instructions on how to customize the text that is Tweeted:

    http://www.addthis.com/academy/changes-to-how-twitter-works-with-addthis/

    It involves adding a snippet of code to the page. Please test this out and let me know if that resolves the issue for you.

    Hope that helps and I do apologize for the back and forth.

    thoughton

    (@thoughton)

    Hi Kristin,

    Yes! That’s exactly what I was looking for. Tested, and it’s working. Many thanks!

    Tim

    thoughton

    (@thoughton)

    Ahh, I may have spoken slightly too soon. The Javascript does work, but is there anyway to make it grab the contents of the twitter:title or twitter:description tags? Thanks!

    Plugin Author addthiskristin

    (@addthiskristin)

    Hey!

    Here is some JavaScript that I wrote up for you to automatically pull the twitter:title:

    <script type="text/javascript">var addthis_share = addthis_share || {}; addthis_share = {passthrough : {twitter: {
        via: "thoughton",
        text: document.querySelector("meta[name='twitter:title']").getAttribute("content")
    }}}</script>

    The updated part being: document.querySelector("meta[name='twitter:title']").getAttribute("content")

    You can see it working here: https://www.screencast.com/t/4XcwByXU

    If the twitter:title is not established on the page, then it will revert to using the og:title.

    Hope that helps! Let me know if there’s anything else I can help with!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘AddThis toolbar sharing og:title instead of twitter:title’ is closed to new replies.