It's better when it's simple

User Tools

Site Tools


Cache and Revisions Eraser Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin Erase entire cache and/or old wiki revisions

Last updated on

Current Version: 1.6.6

This admin plug-in allows you to erase the entire cache and/or old DokuWiki revisions.

Only use this plug-in if you want to clean up your DokuWiki or if the cache gets corrupted.

I won't take any responsibility for data lost due to wrong plug-in usage.

Once old revisions are erased; there's no way to restore them.

Sorry for the long period without updating this project, I've added a new mirror and a repository in GitHub but didn't tested this plug-in with latest version of DokuWiki so please use the plug-in “as-is”, it's a good idea to do a backup first! — JustBurn 2016-02-08 20:39
BTW: Would be nice to have some words about usage. There are not only Freaks out there ….
Nowhere does it actually say HOW to use this plugin once installed???
I'm not good at explaining these sort of things, you are free to add such information, this is a public wiki after all! — JustBurn 2016-02-08 20:27

Special Installation instructions

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

What's new?

NOTE: Older history has been deleted to not make the Wiki page too long, consult readme.txt for the full history.


  • Added Ukrainian Language (Thanks Olexiy Zagorskyi)
  • Compatibility with Doodle & Doodle2 plugins (Thanks schplurtz)


  • Repacked zip correctly again (Only affected v1.6.4, Thanks David for the report)
  • Minor internal improvements


  • Updated French Language (Thanks Christophe Martin)
  • Updated German Language (Thanks Arno Puschmann)


  • Added Spanish Language (Thanks Bernabé García)
  • A few minor changes


  • Compatibility with Discussion Plugin (Thanks Micha Meyer)


  • Plugin now report the latest version date into the Plugins Manager (Thanks Ilya Lebedev)
  • Updated Russian Language (Thanks Alexander Zubkov)


  • Changes into the design and HTML output (Valid XHTML 1.0 now)
  • Added a workaround for Plugins Manager without UTF-8 support for languages that contains UTF-8 characters.
  • Added report level (Detail on output information: Silent; Files only; All)
  • Added information of how many files & directories were deleted
  • Updated Italian Language (Thanks Diego Pierotto)
  • Updated Russian Language (Thanks Alexander Zubkov)
  • NOTE: This version have a new config file revision, you'll need to re-create config.php if you're upgrading.

Available languages

  • English
    • JustBurn, Always updated
  • Portuguese
    • JustBurn, Always updated
  • Brazil
    • JustBurn, Always updated
  • Spanish
    • Bernabé García, 2009-06-27 v1.6.*
  • Ukrainian
    • Olexiy Zagorskyi, 2010-11-10 v.1.6.*
  • German
    • Arno Puschmann, 2009-09-25 v1.6.*
    • 2008-03-23 v1.6.0
    • Alex, 2007-07-29 v1.5.4
    • konus, 2006-07-09 v1.4.*
  • Italian
    • Diego Pierotto, 2008-03-23 v1.6.0
    • EndelWar, 2006-07-09 v1.4.*
  • Russian
    • Alexander Zubkov, 2008-04-08 v1.6.*
    • Kibi, 2006-07-03 v1.3.*
  • French
    • Christophe Martin, 2009-09-13 v1.6.*
    • Flavien Viollet, 2006-10-18 v1.4.*

FAQ (Frequently Asked Questions)

Q: Is it safe to erase DokuWiki cache?

A: Yes, but erasing indexed-search files isn't recommended.


Q: Is it safe to erase old revision pages?

A: Before doing that, make sure all your wiki pages are clean from spam since you can't revert back once all of them are deleted.


Q: Help! I don't know how to use this plug-in and I'm afraid to accidentally damage my wiki.

A: Sorry, there isn't any newbie document available at the moment. Follow the "Download & Install" carefully and don't forget to modify the config.php if you aren't the only administrator using the wiki.


Q: How to modify “configs.php” from the web?

A: v1.5.2 and above you can modify only if “configs.php” doesn't exist.


Q: Is it possible to revert old revisions erasure?

A: Nope, once they are deleted, they cannot be restored or undeleted.


Q: Is it possible to backup old revisions into a single ZIP file for example and delete them in the wiki?

A: It isn’t possible to backup the files with this plug-in. You can try Doku Zip Backup or BackupTool for DokuWiki plug-ins for this purpose.


Q: Installed the plug-in correctly but I'm getting the error “ERROR: Missing or incompatible configurations file (ERR: 1)”.

A: That's normal and always happen when you freshly install the plug-in. The error tells you that there's no configuration file, you just need to setup the configurations into that page and click “Create config.php”… Then “Re-analyze” to refresh the configurations.


Q: Installed a newer version of the plug-in and transferred the old config.php into that directory but I'm getting the error “ERROR: Incompatible configurations file (ERR: 2)”.

A: The newer version of the plug-in may have major changes into the configurations file and isn't recommended or safe to use with old configurations. Please delete the old config.php, run the plug-in, configure all the options and click “Create config.php”.


Q: Installed a newer version of DokuWiki and getting errors 3, 4, 5, 6 or 7.

A: It shouldn't happen but if it does please contact me, don't forget to tell the DokuWiki version your using!


Q: What does the option “Menu position inside the Admin list (Def: 67)” mean?

A: It allows the administrator to organize where the plug-in will be listed in the administrative tasks/menu, the lowest number will be listed on the top of the list.


More Q & A, please?


Any problems, bugs or improvements should be posted here.

NOTE: If someone find a critical incompatibility, please notify me via E-mail with the name of the plug-in in the subject, so I will be much faster to reply and solve the issues. Thank you!

Is it possible to split the plugin into cache-eraser and revision-eraser or to deactivate it in a config file? I don't want an admin to clean the revisions so easily (although I can always revert to a nightly backup) — Hoberion 2006-06-26 16:09

Yes, configurations will be implemented in version 1.3, thanks for the idea :) — JustBurn 2006-06-27 01:12

Issue: backlinks disappear after a cache clean, running the searchindex plugin afterward doesn't solve this issue, an edit of a page linking to that page seems to solve it for that specific page, browsing seems to solve this :) — Hoberion 2006-06-28 21:31

It seems a complex problem, backlinks information is inside the cache himself (data inside extension “.i”?)… although browsing fixes the problem (because cache is re-generated) you can set to turn on/off selection of some common files in v1.3, hope that helps :) . — JustBurn 2006-06-30 04:40

I found there is directory data/meta that contains a lot of “garbage”. As far as I understand, it's place where DokuWiki holds information about indexing status and something like that.

And sometimes orphan .lock files stays in data/pages directory. If you start creating page, and cancel it, orphan lock file will be created. Your utility could hunt for such files. — Kibi 2006-07-04 16:45

Thanks for the suggestions, they are implemented in v1.4 :) — JustBurn 2006-07-07 01:52

Hi, A couple of ideas for this plugin.

  • The development version of DokuWiki can now integrate plugin settings with the config plugin. In preparation for the next release you can use the same system by copying the config functions into your plugin class. For an example, refer to google maps plugin.
  • You aren't using the correct internal variables for your paths.
    • cache ⇒ $conf['cachedir'];
    • attic ⇒ $conf['olddir'];
    • wiki pages ⇒ $conf['datadir'];
    • meta data ⇒ $conf['meta'];

Christopher Smith 2006-07-07 10:46

The configurations should only be changed by the person who has access to website files (System Admin), he can allow all features to be accessed by a Wiki Admin through so a Wiki Admin really don't need to touch the configurations. NOTE: System Admin may not want the “Revisions Eraser” to be enabled, see Hoberion comment above.
Thanks for the internal variables correction, they will be supported in the next version. :) — JustBurn 2006-07-09 02:28

Deleting meta data directory gives empty page (error?) and does nothing. If one did not choose to delete meta data everything goes okay.

What DokuWiki version are you using?
Can you tell if $conf['meta'] pointing to the correct metafiles directory?
If the server is using Apache, can you provide the error log's lines when this happen?
Please email me if you can find the source of the problem and I'll short it out :) — JustBurn 2006-12-25 05:56

Downloaded 1.4.3, but when I tried to run it (to get rid oft he old versions of pages that have accumulated) the dialog box said Erasing all old revisions has been disabled

Is this a general thing or is it a limitation of my DokuWiki installation. The plugin - according to the documentation - is just what I was looking for to delete the old versions but it doesn't want to do it…

Cheers, Edward

In “<dokuwiki directory>/lib/plugins/cacherevisionserase/configs.php”, set $this→configs['allow_allrevisdel'] to true. — sfidanza 2007-01-23
Yes, why didn't I see that. Works brilliantly now, thanks, Edward

Hello JustBurner, hello every one, Trying it under Apache 2.2 on WinXP, I get this error message :

Purge Cache/Révisions version 1.4.3
Couldn't remove directory '/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*........'.
Error erasing all revisions, check file permissions.

I've found a (bad ?) trick to correct the problem.

    // ========== From this ==========
    function rmeverything_revis($fileglob, $basedir)
        } else if (is_dir($fileglob)) {
    // ========== To this ==========
    function rmeverything_revis($fileglob, $basedir)
        } else if (is_dir($fileglob) && (strstr($fileglob, '*') === false)  ) {

Thanks for the plugin, it's very cool. — Jeff 2007-01-25 17:07

I've updated to Apache 2.2 and PHP 5.2.0 and faced the same problem as you, I've rewrote the search engine better in v1.5.0 and now it should work perfectly for you. — JustBurn 2007-02-28 02:04

I have also observed the error noted above “Couldn't remove directory…” w/v1.4.3 on a Windows server w/IIS. If the change noted above to the “rmeverything_revis” function fixes the problem, can the fix be made official by applying the change, increment the version number and making the updated version available through the plugin manager? —GaryV 2007-02-08 21:15

Sorry for the long delay, to tell the trust I've totally forgot about this project and only remembered it today… the good news is “yes”, v1.5.0 is out! :) — JustBurn 2007-02-28 02:04

I have moved data from its default location with all default subdirs within it and changed $conf['savedir'] respectively. After applying the plugin, cache and attic were erased and meta and locks remained untouched. So I have old list of recent changes without any existing revision files. Should I change also $conf['lockdir'] and $conf['metadir']? But why if they are in their default location, that is within the data directory? Thank you for the plugin. Alexander 26.02.2007 0:29:09

Please try v1.5.0 and check if it fix all the issues, fixed the meta variable name based from the latest DokuWiki release, this probably can fix the problem you're having — JustBurn 2007-02-28 02:04
Meta directory is OK, but locks is the same. Debugger shows correct variable values, and the deletion process is successful, but there's no *.locks files in the list of deleted files. — Alexander 2007-03-02 03:49
Please check v1.5.1, tried to email you back because of the Russian language translation but your email seems to filter accounts. :/ — JustBurn 2007-03-05 18:20
Thanks! Now it seems to work fine. I'm not Kibi who made a Russian language file, but I've updated the translation. Mail it to you? — Alexander Zubkov 2007-03-05 21:22
Oh sorry, got confused because his first real name is Alexander too (What a coincidence!)… Well, managed to get a new email account, so please send it to the new email address → — JustBurn 2007-03-07 06:08

Version 1.5.1 handles configs.php incorrectly: If you set, e.g., “cache_del_metafiles” to -2, it still shows the item checked in the admin panel. Please rewrite this code. — Robert Riebisch 2007-03-27 17:10

Thanks for the bug report, v1.5.2 should handle it correctly. — JustBurn 2007-03-30 01:58

I just manually updated this plugin, and found a small bug. I updated by deleting the existing cacherevisionserase directory and dropping the new one in place. The first time I loaded the admin page, it allowed me to create the configs.php file (nice). However, when it did, it created the line '$this→configs['allow_allcachedel'] …' twice and didn't create the line '$this→configs['allow_allrevisdel'] …' at all. This isn't a major bug since we just have to copy the line from the “” distribution file. — Gary 2007-05-02 19:11 EDT

Thanks for the bug report (Again! :P), although the 2nd was implemented correctly (checked for 'allow_allrevisdel'), the writing to the configs.php wasn't (wrote 'allow_allcachedel')… my bad, really did a dumb mistake :\ … anyway there's v1.5.3 that fix it. — JustBurn 2007-05-04 17:25

The first download link doesn't work at all; site not found. The second appears to work, but then I get a message “No plugins found, or there has been an unknown problem during downloading and installing.”, I could provide a mirror, if you like. I'll send you an email.

Yes, the first link seems offline at the moment, but the second link works fine without any error message. I've replied your e-mail. — JustBurn 2007-07-03 01:32

Fix the Update plugin version (date) in the plugin scripts.

getInfo().date ? Isn't the date of the creation of the plugin ? — JustBurn 2008/04/01 14:51
I'm not sure what do you mean, but
Ilya Lebedev 2008/04/01 16:40
then getInfo().date should be the last update date? Nobody warned me about that since version 1.0

(e.g. 'date' ⇒ '06-05-2006', to 'date' ⇒ '31-03-2008',)
I don't have anything else to change/add right now, should I release 1.6.1 with only that change made? — JustBurn 2008/04/02 18:54

It's just nice to see when the last actual update took place. Yes, please update this with the next releases. If you use CVS/SVN you could set $Date$ placeholder there to have the actual date. — Ilya Lebedev 2008/04/03 12:22
Okay, it's done on v1.6.1, from now on the getInfo().date will reflect the latest version :) — JustBurn 2008/04/10 18:43

Would it be possible to extend the plugin, so what only in a certain namespace the old revisions are deleted? Roland Spatzenegger 2008/05/26

That should require a lot of work (and time) to be implemented, but I'll keep that in mind if I decide to improve the plug-in greatly. — JustBurn 2008/09/07 18:34

There is a problems with the Discussion Plug in!! in the META directory there are also the discussions stored as “*.comments” files. Is there a way to prevent deleting this files`? What can be changed in sources to do that? Micha Meyer 2008/08/18

Sorry to only notice the posts today, I've been away for so long.
Version 1.6.2 will patch that issue, thanks for the report. — JustBurn 2008/09/07 18:34
Problem is solved! Thank you!
Micha Meyer 2008/09/09

It seems to me that version 1.6.2 does not delete at least some meta files. I'm using it with version 20090214 of DokuWiki on a Debian Linux computer.

The meta files are in a subdirectory of /var/lib/dokuwiki/data/meta/.

Perhaps cacherevisionseraser should search subdirectories for meta files to delete.

Thanks, Kingsley G. Morse Jr.

cacherevisionseraser does search subdirectories…
PHP have full permission on all the meta folders/files (including subdirectories)? there is any link file/directory inside it? what type of files that doesn't get deleted? — JustBurn 2009/06/25 04:00

I installed the newest Version (1.6.4) of cacherevisioneraser into my DokuWiki (2009-02-14b) and have a few problems:

  1. automatic update via pluginmanager not possible - if i use one of the links from this page it installs a new plug-in called “lang”
  2. during a manual install, I need to rename the plugin folder from “cacherevisioneraser” to “cacherevisionerase” otherwise the Plugin Manager cannot show any information and there is no entry in the Admin Menu
  3. Also the Plugin information are incomplete. It shows me at “source” → unknown and at “installed” also “unknown”

Thanks, David

1) Sorry, it seems in the moment of the release I've accidentally zipped the content of the folder instead of the folder itself, that explains why 1.6.4 doesn't install like it should.
2) The folder name is indeed “cacherevisionerase”, again, it was because the package was zipped incorrectly.
3) That's okay if you installed manually since DokuWiki didn't collect the information of where it downloaded the file.
Sorry for the long delay to reply, I'm working on other projects at the moment and sometimes I forget to check this one. — JustBurn 2009/11/26 19:35

I separated the files of my dokuwiki installation according to the common Linux folder hierarchy:

  • dokuwiki (inc, lib, …) ⇒ /usr/share/dokuwiki
  • configuration (conf) ⇒ /etc/dokuwiki
  • pages, … (data) ⇒ /var/lib/dokuwiki

Here the lib folder is write protected and thus not possible to create a configuration file for this plugin. I suggest to let the plugin create the config.php in the conf folder instead of the plugin folder (lib/plugin/cacherevisioneraser) and to rename it to a clear name like cacherevisioneraser.plugin.php. I agree this is a bit longish :) I was inspired by acl.auth.php and words.aspell which use a fine to coarse order of classifiers. — knut 2010/07/16

Atm, config.php serve only as a way to restrict the admins/moderators of certain tasks that the wiki's super-admin (person hosting the wiki) may not want. On default it allows all tasks to be performed and I don't see why this file need to be changed more than once.
In case your folder is write protected on HTTP side, just rename “” to “configs.php” and the plug-in will work fine. — JustBurn 2010/08/04 18:54

Hum, when cleaning the meta dir, all the doodles content on the wiki are cleared. doodle and doodle2 plugin use file with .doodle extension in the meta dir. The solution I found is to add a line in function rmeverything_meta in file cacherevisionserase/admin.php that tests if the extension is doodle, and do nothing if it is the case. There was already one such test for the discussion plugin, and the comment extension, the change is almost a copy/paste.

--- cacherevisionserase/admin.php.orig	2010-10-02 07:47:14.595262149 +0200
+++ cacherevisionserase/admin.php	2010-10-02 07:48:38.667262189 +0200
@@ -420,6 +420,7 @@
 			if (strcmp($fileglob2, '/_dummy') == 0) return true;
 			$pathinfor = pathinfo($fileglob2);                                              // For compability with Discussion Plugin
 			if (strcmp(strtolower($pathinfor['extension']), 'comments') == 0) return true;  // For compability with Discussion Plugin
+			if (strcmp(strtolower($pathinfor['extension']), 'doodle') == 0) return true;    // For compatibility with doodle Plugin
 			if (@unlink($fileglob)) {
 				if ($outputinfo > 0) ptln('<strong>'.$this->lang['deletefile'].'</strong>'.(($outputinfo==2) ? ' ('.$this->lang['meta_word'].') ' : ' ').'<em>"'.$fileglob2.'"</em>.<br />');

schplurtz 2010/10/02 08:10

Thanks for the report, your patch is applied in version 1.6.6 :) — justburn 2010/11/23 00:06

After use of a plug-in I receive the message: “Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /var/www/wiki/inc/cache.php on line 283” on the main page 2010/11/25 23:56 Shtirlits(Not regidterd ssory)

This bug is connected with a plug-in nspages, and with its parameter -subns 2010/11/28 22:32 Shtirlits(Not regidterd ssory)

2016-10-29 Data-Plugin - Attention: deleting old revisions - deletes data.sqlite3 used by data.plugin

plugin/cacherevisionseraser.txt · Last modified: 2021-04-24 10:13 by mprins

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