3

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?

  • meta tags do not have a closing slash. – Rob Nov 11 '15 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 Nov 12 '15 at 10:30
  • I've seen some sites use it and some don't. – Abhishek Nov 12 '15 at 19:35
5

<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" /> 
  • 1
    meta tags do not have a closing slash. – Rob Nov 11 '15 at 13:56
  • 4
    @Rob: Not correct. In HTML5, both ways are allowed for void elements; in XHTML5, only the one with closing slash is allowed. – unor Nov 12 '15 at 10:27
  • 2
    @Rob: 1) How do you know it’s HTML, and not XHTML (or both)? But it doesn’t matter, as (like I explained) HTML allows it. 2) You don’t seem to understand the HTML5 specification. Stuff like this is specified in section 8, not in meta’s definition. 3) You made an incorrect statement about meta elements; I don’t see how it should matter then if the category of the meta element is an "exception" or not, because it is about meta, not any other element. – unor Nov 12 '15 at 13:29
  • 2
    @Rob: Wrong again. You said "meta tags do not have a closing slash"; you did not say that it’s just "pointless" to add them. -- It is defined in the HTML5 specification, just not in the section you would like to find it (it would make no sense to define it in meta’s definition, because it would have to be repeated for all other void elements; it’s, like I linked to, defined in the section about the syntax). -- I never said that it’s needed, I said it’s "allowed". – unor Nov 12 '15 at 13:36
  • 2
    @Rob: I already linked to the section where it’s defined. Let me quote for you, it’s step 6 of the 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." --- FYI, the examples in the HTML5 spec are non-normative. – unor Nov 12 '15 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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