Use unique title tags for both the Twitter share and Facebook ... og: title overwriting twitter: title

I have two social mailing metadata that I use og:title for Facebook and twitter:title for Twitter. I need everyone to be different. Twitter always uses an open column heading, and I need to find a way to provide different resources for each resource. Currently my code is as follows.

 <meta content="my unique title for facebook" property="og:title" /> <meta content="a description tag here for facebook" property="og:description" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="my unique title for twitter content" /> 

The sharing function uses the "Add this" https://www.addthis.com/academy/setting-the-url-title-to-share/ , the software is a template for several sites, so editing HTML is not easy I want to find a solution, using only meta tags.

I use

 <meta name="twitter:title" content="my content" /> 

and share this resource Twitter still uses the OG tag.

Add This code looks like

  <!-- AddThis Button BEGIN --> <!-- Go to www.addthis.com/dashboard to customize your tools --> <script type="text/javascript"> var addthis_config = { services_compact: 'email, facebook, twitter, digg, reddit, linkedin, myspace, plaxo, blogger, livejournal, more', services_exclude: 'print' }; var addthis_share = { url_transforms : { shorten: { twitter: 'bitly' } }, shorteners : { bitly : {} } }; </script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-56e1e3b04418084b"></script> <!-- AddThis Button END --> 

HTML

  <a href="javascript:;" class="menuLink addthis_button"><i class="fa fa-share"></i> <span>Share</span></a> 
+5
source share
1 answer

Twitter scraper will always use twitter meta tags over open chart

According to their docs:

When the Twitter map processor searches for tags on the page, it first checks the Twitter property, and if not, falls back to the supported Open Graph property. This allows certain independentl page

OP edited his question, they originally used property tags instead of name tags

It should be

<meta name="twitter:title" content="blah">

instead

<meta property="twitter:title" content="blah">

It works with this change.

+1
source

Source: https://habr.com/ru/post/1268134/


All Articles