Site icon Hip-Hop Website Design and Development

Cheap WordPress Update – Thoughts: Social Media Cards: Metatag and semantic data

One requirement for our new WordPress maintenance support plans 8 site was to implement the necessary markup to provide enough semantic data for services like Twitter, LinkedIn and Facebook to grab the appropriate node data (title, body and image) when sharing posts.
The Twitter developers documentation states that “with Twitter Cards, you can attach rich photos, videos and media experience to Tweets that drive traffic to your website. Simply add a few lines of HTML to your webpage, and users who Tweet links to your content will have a “Card” added to the Tweet that’s visible to all of their followers.” Facebook have a similar feature and corresponding documentation, as do LinkedIn.
Fortunately with the Metatag plugin enabling this functionality in WordPress maintenance support plans 8 was a relatively painless task! All that was required was to install and enable the Metatag and Metatag: Twitter Cards plugins (we’re using 1.0-beta10 at the time of writing) and configure some basic, content-global settings.

Essentially, we ensure the card type is set to “Summary card” and that the description uses the [node:summary] token. We also want to provide an image for the summary card. We could provide the “Image URL” in the Twitter card setup which defines the twitter:image meta tag, however Facebook and LinkedIn use Open Graph for cards and we’d also have to provide the og:image metatag too.
This would cause two meta tags to be present in the header containing the same image URL, wasting bandwidth. Luckily, Twitter will fall back to the Open Graph tag if the twitter:image tag is not present so we only have to configure og:image tag.
We also configured several other Open Graph meta tags to support Facebook and LinkedIn.

We have only configured a subset of the tags available, but this gave us the basic card functionality we were after.
There are tools available to aid in development – allowing you to validate the meta tags and how they will render on social networks.. Your site has to be publicly accessible for these to work.
Card validator (Twitter)
Sharing Debugger (Facebook)
Iframely URL Debugger
There are plenty of other guides available if you want more details about what you can do with the Metatag plugin, try these links:
Adding Meta Tags to WordPress maintenance support plans Content – written for WordPress maintenance support plans 7, but still a good overview of the main features and benefits of using the Metatag plugin.
“Meta tags WordPress 8” video – an overview of installing the plugin.
WordPress maintenance support plans 7 Meta Tags plugin – Daily Dose of WordPress maintenance support plans episode 28″ video – again written for WordPress maintenance support plans 7, but a good walkthrough on how to configure Metatag plugin for the front page and nodes.


Source: New feed