Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use the same meta tag for opengraph and schema.org

I dont like the amount of tags in the head of my document. here is an example of some meta tags.

<!--w3c-->    
<title>Page Title</title>
<meta name="description" content="great description">

<!--schema.org-->
<meta itemprop="name" content="Page Title">
<meta itemprop="description" content="great description">

<!-- opengraph-->
<meta property="og:title" content="Page Title">
<meta property="og:description" content="great description">

Is it possible to combine the tags/properties to reduce the code size without affecting SEO? for example
<title itemprop="name">Page Title</title>
itemprop attributes can be used anywhere so I'm pretty sure this is fine but as far as i am aware the property="og:*" attribute must be used with a meta tag.
So is the following markup acceptable?

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


and how will this affect SEO?

many thanks

like image 255
TarranJones Avatar asked Dec 05 '13 13:12

TarranJones


People also ask

Can you have two meta tags?

Yes, this is definitely possible and valid (and actually most of the times even necessary). Basically, you can have an arbitrary number of them, as long as you put all of them into the head section of your website.

What is Open Graph metadata?

Open Graph meta tags are snippets of code that control how URLs are displayed when shared on social media. They're part of Facebook's Open Graph protocol and are also used by other social media sites, including LinkedIn and Twitter (if Twitter Cards are absent).

What is the difference meta tag used for?

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data. <meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.


1 Answers

HTML+RDFa 1.1 and Microdata extend 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.

Microdata (W3C Note) defines:

If a meta element has an itemprop attribute, the name, http-equiv, and charset attributes must be omitted, and the content attribute must be present.

That means:

  • It’s not allowed to use Microdata’s itemprop attribute together with HTML5’s name attribute.

  • It’s allowed to use RDFa’s property attribute together with HTML5’s name attribute:

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

    (possibly an issue with having this in the body instead of the head)

  • It seems to be allowed to use Microdata’s itemprop attribute together with RDFa’s property attribute if HTML5’s name attribute is not provided:

    <meta itemprop="description" property="og:description" content="great description" />
    

    (but the W3C Nu Html Checker reports an error)

like image 98
unor Avatar answered Nov 10 '22 00:11

unor