Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining the meta description and Open Graph Protocol description into one tag

Is it possible to combine the meta description and Open Graph Protocol description…

<meta name="description" content="My meta description copy." /> <meta property="og:description" content="My meta description copy." /> 

…into one when they contain the same content?

<meta name="description" property="og:description" content="My meta description copy." /> 
like image 667
Boost Ventilator Avatar asked Jun 01 '11 14:06

Boost Ventilator


People also ask

How do you add meta tags to Open Graph?

Just go to Page Settings > Social Image > Upload. If you need to add other OG tags and customize the default settings, go to Page Settings > Advanced > Page Header Code Injection. Read the following section on adding the tags manually and copy-paste the code there.

How do you add meta description to tags?

If you want to add a meta tag to your website, search for instructions about modifying the <head> of your page on your CMS (for example, search for "wix add meta tags"). Make sure that every page on your site has a meta description. Create unique descriptions for each page on your site.

Can you have multiple meta description tags?

Typically, a page should only have one meta description. If there are multiples, it is usually an accident, and may confuse search engines or bring a bit of uncertainty in how you can expect the SERP snippet to look.

What is Facebook Open Graph tags?

Facebook's OpenGraph metadata allows users to share web pages on Facebook. If you add OpenGraph meta tags to your posts and pages, Facebook will display a preview with images and an excerpt when a link to your site is shared.


2 Answers

Yes, you can combine them. To test it, I made the simple HTML page below, uploaded it to a server, then ran the page through Facebook's URL Linter. It reported no warnings related to the description tag (only about the missing og:image tag) and correctly read the description.

<!doctype html> <html>     <head>         <meta name="description" property="og:description" content="My meta description copy." />         <meta property="og:title" content="Test page" />         <meta property="og:type" content="article" />         <meta property="og:url" content="http://example.com/ogtest.html" />     </head>     <body>     Test     </body> </html> 

Note that, if the og:url value is different to the current page url, Facebook will look for a description on that url instead of the current one and ignore the current page's description tag.

It might also interest you to know that, even though it's possible to combine the two description tags, Facebook doesn't do this on their own website.

like image 89
Nick Avatar answered Sep 20 '22 06:09

Nick


Some additional info on why this is possible/allowed:

HTML+RDFa 1.1 extends HTML5’s meta element.

HTML+RDFa 1.1 (W3C Recommendation) defines:

If the RDFa @property attribute is present on the meta element, neither the @name, @http-equiv, nor @charset attributes are required and the @content attribute MUST be specified.

So when using RDFa's @property the name is not required but it is not forbidden either, making

<meta name="description" property="og:description" content="great description"> 

perfectly ok according to spec.

I found this from the answer to this related question: Is it possible to use the same meta tag for opengraph and schema.org

like image 44
ZephirNL Avatar answered Sep 19 '22 06:09

ZephirNL