Default MediaWiki installation doesn’t provides you any feature to delete multiple pages at once. And no matter how many protections are active, spamming will always be present to a certain level unless you are running a completely private wiki.
Bot flood is the most common attack that happens on most wiki websites. In this attack, one or more vandals may attempt to run bots that can edit, move and create new pages at a very high speed and upload unwelcome versions of images.
As said by MediaWiki developers, “This is the most frequent kind of vandalism on most wikis and usually done for spam purpose.” We have already discussed about enabling ReCAPTCHA on MediaWiki in order to minimize such type of spams.
Now today in this lesson you will learn about deleting spam and unwanted pages in bulk on your MediaWiki installation.
How To Delete Multiple MediaWiki Pages?
Start by downloading DeleteBatch extension from here and then follow the given steps:
- Upload the extension in your website’s ‘Extensions’ directory located in your site’s root (public_html).
- Extract all files and make sure they are places in directory with title
- Open LocalSettings.php file (located in root directory) and add this line:
That’s it. By default, it only allows bureaucrats to delete batches but you can change it and let sysops to delete pages:
$wgGroupPermissions['bureaucrat']['deletebatch'] = false; $wgGroupPermissions['sysop']['deletebatch'] = true;
To start deleting pages, type ‘Special Pages’ in search box and hit ENTER. Open ‘All Pages’ list.
Select and copy the pages you want to remove off from your MediaWiki website.
Now type ‘Special:DeleteBatch‘ in search box and hit ENTER to visit bulk delete page. There you can delete pages either through the form by pasting page names or by uploading a text file containing names (and optional delete reasons separated by |) of the deletable pages.