0

I have installed Mediawiki SEO extension. To add meta tag in head section they have the syntax something like that given below, but can't add date published meta tag.

{{#seo:
    |title={{#if: {{{page_title|}}} | {{{page_title}}} | Welcome to WikiSEO}}
    |titlemode={{{title_mode|}}}
    |keywords={{{keywords|}}}
    |description={{{description|}}}
    |google-site-verification= dnweo23234k23exn23lx23xn23n
    |fb:app_id= 1232425634
    |fb:admins= Mehrab Tamim
    |date-published= ????which value should put here
 }}
Regolith
  • 2,944
  • 9
  • 33
  • 50
Mehrab Tamim
  • 71
  • 1
  • 6

1 Answers1

0

There is no meta tag which provides the function you search. OpenGraph has a property called article:published_time with which you can provide the publication date of an article on the website, but natively the MediaWiki SEO extension doesn't support this tag, as you can read in it's documentation. This means you have to add the tag manually.

To add this tag (is is btw. untested!), open the file WikiSEO.body.php and add a new value to the WikiSEO::$valid_params-array, called article:published_time. Then add a new index called article:published_time with the value property to the WikiSEO::$tag_types-array and you should be good to go.

Small example:

protected static $valid_params = [
     // other entries
     "article:published_time",
];

protected static $_tag_types = [
     // other entries
     "article:published_time" => "property",
];
Dan
  • 5,140
  • 2
  • 15
  • 30
  • Thank's a lot. I got it at last. But how can I call the new page published date and existing page modified date in this meta tag? – Mehrab Tamim Aug 01 '17 at 08:08
  • You can try do something with the [`{{REVISIONTIMESTAMP}}`](https://www.mediawiki.org/wiki/Help:Magic_words#REVISIONTIMESTAMP) magic word of MediaWiki. Otherwise you have either to set the dates manually or change the [`modifyHTML()`](https://github.com/tinymighty/wiki-seo/blob/master/WikiSEO.body.php#L251)-method of the `WikiSEO` class. – Dan Aug 01 '17 at 12:50