It's better when it's simple

User Tools

Site Tools


WikiStats Plugin

Compatible with DokuWiki

  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" unknown
  • 2018-04-22 "Greebo" unknown
  • 2017-02-19 "Frusterick Manners" yes

plugin wikistats Plugin for DokuWiki

Last updated on
Syntax, Helper, Action

The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on Recommended are public repository hosts like GitHub, GitLab or Bitbucket.

Similar to numberof, stats

Tagged with !missing, report, statistics


Search and install the plugin using the Extension Manager.

Refer to Plugins on how to install plugins manually. If you install this plugin manually, make sure it is installed in lib/plugins/wikistats/ folder is called different it will not work!

This plugin requires the modification of the template (Often main.php). Decide where you want to insert the Stats link in your template and insert the following code:

if (!plugin_isdisabled('wikistats') && 
   ($wikistats =& plugin_load('helper', 'wikistats'))) { 

Most likely you want to do that in the /lib/tpl/default/main.php inside the <div id="bar__bottomright"/> as follows:

<div class="bar-right" id="bar__bottomright">
  <?php if (!plugin_isdisabled('wikistats') && 
           ($wikistats =& plugin_load('helper', 'wikistats'))) 
             $wikistats->add_stats_link(); ?>
  <?php tpl_button('subscription')?>
  <?php tpl_button('admin')?>
  <?php tpl_button('profile')?>
  <?php tpl_button('login')?>
  <?php tpl_button('index')?>
  <?php tpl_button('top')?>&nbsp;

For Dokuwiki “Release 2017-02-19b Frusterick Manners”, you should process as follows:

<!-- SITE TOOLS -->
<div id="dokuwiki__sitetools">
  <h3 class="a11y"><?php echo $lang['site_tools']; ?></h3>
  <?php tpl_searchform(); ?>
  <div class="mobileTools">
    <?php tpl_actiondropdown($lang['tools']); ?>
      if (!plugin_isdisabled('wikistats') && ($wikistats = plugin_load('helper', 'wikistats')))
      tpl_toolsevent('sitetools', array(
        tpl_action('recent', true, 'li', true),
        tpl_action('media', true, 'li', true),
        tpl_action('index', true, 'li', true)

Now, you have to create the stats page following the namespace and name given in the plugin admin configuration (wiki:statistiques is the default value).

To create this page, do as usual :smile:

And add some code within, for example:

====== Statistiques ======

{{wikistats>ns = -wiki & type = stats}}


Type of stats displayed

To display only topic (pages) stats

{{wikistats>type = pages}}

To display only resources stats

{{wikistats>type = medias}}

To display all stats (including namspaces and tags (if tag plugin is installed))

{{wikistats>type = all}}
Note that the type parameter is mandatory

Whitelist/blacklist by namespace

By default plugin shows the stats of the entire wiki. To restrict the statistics to a given namespace and its sub-namespaces you can specify its name either directly or using ns parameter:

{{wikistats>foo & type = pages}}
{{wikistats>ns = foo & type = pages}}

The ns parameter supports both inclusion and exclusion of the namespaces. If a namespace name starts with a minus sign that namespace will be excluded. Also you can assign a number of namespaces as a comma separated list:

{{wikistats>ns = -foo & type = pages}}
{{wikistats>ns = foo, bar, -bar:baz & type = pages}}

The first example will show the pages stats in all namespaces except of “foo”, the second one will include “foo” and “bar” namespaces except of “bar:baz” sub-namespace.

Note that namespaces restrictions are not supported for tags and namespaces stats

Multiple parameters syntax

If you want to pass a number of parameters to the plugin they should be separated with an ampersand (&), for example:

{{wikistats>ns = -foo & type = pages}}

The above syntax would display pages stats for the entire wiki except for the “foo” namespace.


Git repository

A public git repository is available here FIXME

Bugs and features request

Please report issues in the bug tracker FIXME


  • English
  • French
  • Spanish
  • German

ToDo / Wish list

  • Add bargraph display
  • Allow configuration of bar color
  • Support namespaces restrictions for tags stats
  • Handle namespaces with medias and without pages as an error (could be configured)
  • Color for namespace errors could be configured
  • Add Docker support for development environnement
  • Add total for resources and namespaces stats



The ten most recent changes:

{{rss> date author}}

A full list can be found on Github FIXME


  • 2017-06-29
    • Add TOC support
    • TOC display could be desactivated in plugin administration
  • 2017-06-28
    • 2017-06-28 release
  • 2017-06-27
    • Add option to change render style
    • Add resources types translations
    • Namespace stats now show medias counts
    • Update General Informations and Installation instructions
    • Plugin now display stats even if Tag plugin is not installed
    • Namespaces are sorted in ascending alphabetical order
    • Code refactoring
  • 2017-06-22
    • Add stats icon to wiki template
  • 2017-06-20
    • Initial release


None actually.


plugin/wikistats.txt · Last modified: 2021-02-14 03:06 by desbest

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki