8

I just changed my Wordpress theme and I can't find <meta property="article:tag" content=" " /> in my posts and pages metadata. Are they really necessary? If they are how do I add them back?

4
  • meta tags do not have a closing slash.
    – Rob
    Commented Nov 11, 2015 at 13:55
  • What makes you think that it could be necessary? Or, assuming that you know what it’s used for, what do you consider "necessary"?
    – unor
    Commented Nov 12, 2015 at 10:30
  • I've seen some sites use it and some don't. Commented Nov 12, 2015 at 19:35
  • The Open Graph protocol page itself uses closing slashes. While not required in HTML 5 void elements, they are permitted, and are recommended best practice for HTML+XML compliance. ogp.me
    – Slam
    Commented May 15, 2020 at 8:02

1 Answer 1

8

<meta property="article:tag" content="Article Tag" /> is one of the Facebook Open Graph tags. Having social media metadata in the website is one of the best practice as it will tell how our webpage's Title, URL, Image, Description, site_name etc should display while sharing. But I don't think <meta property="article:tag" content="Article Tag" /> is necessary as it is not in the Standard Open Graph tags

<!-- Open Graph data -->
<meta property="og:title" content="Title" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:image" content="http://example.com/image.jpg" />
<meta property="og:description" content="Description" />
<meta property="og:site_name" content="Site Name" />
<meta property="fb:admins" content="Facebook numeric ID" />

Still if you want to add that tag you can add like

<!-- Open Graph data -->
<meta property="og:title" content="Title" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:image" content="http://example.com/image.jpg" />
<meta property="og:description" content="Description" />
<meta property="og:site_name" content="Site Name" />
<meta property="article:published_time" content="2015-11-11T19:08:47+01:00" />
<meta property="article:modified_time" content="2015-11-11T19:08:47+01:00" />
<meta property="article:section" content="Article Section" />
<meta property="article:tag" content="Article Tag" />
<meta property="fb:admins" content="Facebook numberic ID" /> 
2
  • 7
    The closing slash isn't needed in HTML5, but it is valid. Both with and without the closing slash are allowed for void elements; in XHTML5, only the one with closing slash is allowed. From step 6 of the HTML5 Start tags format: "[…] Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single "/" (U+002F) character."
    – unor
    Commented Nov 12, 2015 at 10:27
  • It is: ogp.me
    – djibe
    Commented Mar 31, 2023 at 7:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.