Link preview meta tags
I tested every link preview meta tag on every major social media site and messaging app — so you don't have to!
It was really boring.
Social media is a bad for your mental health, your privacy, your democracy — and for the performance of your website.
Peak at the source code of most websites, look between the <head>
tags, and you're likely to see a bunch of meta tags like this:
The purpose of these tags is to tell messaging and social media apps how to display link previews
.
Link previews
let people know about a link before they click on it. They display a url's title
, description
, and sometimes an image
.
Here's an example of a link preview being displayed in iMessage
:
How to create link previews
There are four popular systems for creating link previews:
These systems also have more than one way of being implemented. (See the table below)
All these systems involve placing code snippets between the <head>
tags of your page.
Adding these code snippets helps bots run by facebook, twitter, and other apps, build link previews
of your site.
But, this code also weighs down your website for all your human visitors — and many websites implement three or four of these methods.
You could just not have any of these tags — that's fine.
But assuming you want link previews
of your website to be displayed — what is the most effective combination of these tags?
That's something the world needed to know — so I built link preview tester. It's probably the most boring tool anyone has ever made — and I really hope someone finds it helpful!
Which meta tags work on which apps?
The following table shows the results of using the link preview tester on some of the most popular social media and messaging apps.
It shows which <meta>
tags display link previews
on which apps.
Schema.org | oEmbed XML | oEmbed JSON | ||||||||||||
meta description | Open Graph | Open Graph Pointer | Twitter Card | microdata | JSON-ld | Rich | Photo | Video | Link | Rich | Photo | Video | Link | |
no | yes | no | yes | no | no | no | no | no | no | no | no | no | no | |
Slack | yes | yes | no | yes | no | no | no | no | no | no | no | yes | yes | yes3 |
iMessage | no | yes | no | yes | yes | no | no | no | no | no | no | no | no | no |
Discord | yes | yes | no | yes | no | no | no | no | no | no | yes2 | yes2 | yes2 | yes2 |
yes | yes | no | no | yes | no | no | no | no | no | no | no | no | no | |
yes | yes | no | no | no | no | no | no | no | no | no | no | no | no | |
Signal | yes | yes | no | no | no | no | no | no | no | no | no | no | no | no |
Telegram | yes | yes | no | yes | yes | no | no | no | no | no | no | no | no | no |
Discourse | no | yes | no | yes | no | no | no | no | no | no | yes | yes | yes | yes |
no | yes4 | no | no | no | no | no | no | no | no | no | no | no | no | |
tumblr | yes | yes | unknown | no | no | no | no | no | no | no | no | no | no | no |
no | yes | no | no | no | no | no | no | no | no | no | no | no | no | |
yes | yes | unknown | yes2 | yes | yes | yes | yes2 | yes | yes | yes | yes2 | yes | yes | |
viber | no | yes | unknown | yes | no | no | no | no | no | no | no | no | no | no |
line | yes | yes | no | yes | no | no | no | no | no | no | no | no | no | no |
- Only works with a
meta description
tag - Doesn't show thumbnail, photo, or video
- Requires a non-spec
description
orimage
key - Only uses the
<title>
tag
Open graph tags are the clear winner
I was hoping to discover that one of the open source methods — schema.org
or oEmbed
worked well on enough of these apps that I could recommened them.
But it seems the clear winner is Facebook's Open Graph tags.
What if i don't want Facebook or Twitter proprietary meta tags polluting my lovely website?
Facebook and Twitter are basically evil — so it's understandable if you don't want to use their tags.
You could do what this website does, and just use a meta description
tag, and learn to live with there being no images in your website's link previews…
…or, you could use a combination of meta description
, Schema.org microdata
and oEmbed JSON
— the combo which will work on the most number of apps, without using proprietary tags.