Deleting all default wiki pages in Trac
I am currently evaluating Trac as a web management tool for a school project. By default Trac comes with lots of standard wiki content, mostly help instructions, which i don't need. So here is a simple script which saves the current wiki content and then deletes all pages.
cd /path/to/your/trac/project
mkdir wiki-exported && trac-admin . wiki dump wiki-exported
for page in $(trac-admin . wiki list | awk '{ if($1 ~ /^(Trac|Wiki).*$/) print $1}'); do
$(trac-admin . wiki remove $page);
doneIf you want to restore your wiki content then run
trac-admin . wiki load wiki-exportedTo upgrade to the latest help instruction issue the following command
trac-admin . wiki upgradeMarc
Comments (1)
if you're on windows
if you are using windows, create a batch script named delete_wiki.bat with text below and run it in environment directory for /f "skip=3 tokens=1" %%I in ('trac-admin . wiki list') do ( trac-admin . wiki remove %%I )
