Can I combine name="description"
and property="og:description"
in same meta tag?
CodePudding user response:
You should not combine these two properties because the nature of these two things is different.
name="description" is the description that search engines use and property="og:description" is the property that is used by your social media sites to show specific descriptions to your viewers on social platforms. But if it's not present some times it picks either some paragraph from your content or the name="description".
CodePudding user response:
TL;DR No.
In your code, sure, you can do anything. ;) But it doesn't grant that it will be working and interpreted well by other systems.
As mentioned in the HTML standard:
description - The value must be a free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine. There must not be more than one meta element where the name attribute value is an ASCII case-insensitive match for description per document.
As mentioned in One Graph description:
While many different technologies and schemas exist and could be combined together, there isn't a single technology which provides enough information to richly represent any web page within the social graph. The Open Graph protocol builds on these existing technologies and gives developers one thing to implement.
optional metadata, og:description - A one to two sentence description of your object
Historically, HTML standards were much earlier and widely used - for search engines (SE - Google, Bing, Yahoo!, ...), than OG protocol (preview cards for URL sharing - chats, messengers, Facebook, ...).
SEs take a look at "description" but I'm not sure about "og:description". From the opposite side, a chatbot crawler for sure checks "og:description" and I'm not sure about "description". Both of these elements could contain the same text. Or different.
Usually, "description" is a rare updateable, its content is mostly "for machines". "og:description" could be changed more often to reflect a page's current state, this one is mostly "for humans". For example, a product page can have its general "description" for SEs and their results, current marketing text is better to be placed in "og:description".
Yes, they have close semantic values but technically they are from different mechanisms and for different purposes.
Use them to achieve your goals.