Summary: Store pages as XML files
Version: 2021-10-28
Prerequisites: Requires at least PmWiki version: 2.2.0; last tested on PmWiki version: 2.2.45
Status: Beta
Maintainer: Anomen
Users: (View? / Edit)
Discussion: XMLPageStore-Talk

Questions answered by this recipe

Store pages as XML.

  • pages easily editable in plain text editor
  • better handled by versioning systems (text is no longer single long line)
  • export/import pages using various tools with XML support


The XMLPageStore.phpΔ script stores pmwiki pages into xml files in the wiki.d/ directory.


To use this script, simply place it in your cookbook directory and add the following lines to local/config.php:

  $EnablePageStoreXML = 1;
  $WikiDir = new XMLPageStore('wiki.d/{$FullName}');

There's no need to convert or modify your existing pages; xmlpagestore.php can read existing pages without any difficulty. As pages are edited and saved, they will be then saved as XML files in wiki.d/. Please make sure the above cookbook script is loaded before other scripts.

If you want to convert all of your files at once append the following line to local/config.php:



Use $EnablePageStoreXML variable to enable/disable writing xml files.



Change log / Release notes

  • 2011-04-22 - added to PmWiki Cookbook
  • 2011-09-15 - minor fixes
  • 2012-12-27 - added support for converting all pages
  • 2021-10-27 - fix compatibility with PHP 8

See also

git repo



See discussion at XMLPageStore-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.