I want to follow good SEO practices by adding
alt tags to all my images.
For Facebook sharing, I have this code:
<meta property="og:image" content="...">
Can I add an
alt="Facebook image" to that?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
No, you do not need an
alt attribute on that meta tag. In fact, it is not even allowed as others have already said.
However, (today) Open Graph specifies and even suggests to provide the image alt text via an
og:image:alt property. See http://ogp.me/#structured.
Note that the
og:image meta tag is not an image tag, but rather a hint on which image should be used when displaying that page somewhere else. Thus, the specified alt text will probably improve the image usage for that other site that embeds your page, e.g. Facebook.
meta element cannot have an
alt attribute in any HTML specification. Technically, you could have the attribute
title="Facebook image", since the
title attribute is allowed for all elements according to HTML5 LC (though not HTML 4.01), but it is very unlikely that any browser or search engine cares about it for
meta; so it would matter as comment-like documentation only.
og specification does not have alt attribute. You can check valid attributes at the open graph protocol website.