Topic on Project:Support desk

Bulk Delete Files From Wiki

4
Summary by Arnab vani

deleteBatch.php not only allows deleting pages in bulk but also all sorts of files uploaded to the wiki.

Arnab vani (talkcontribs)

Hey there guys,

MW 1.27.2

I noticed there are few extensions to bulk upload files to Mediawiki installation.

Currently, I have been trying to do the opposite. And I'd like to be able to bulk delete files with specific file extensions.

For example, in my case, I want to mass delete all files with extension .mp3 which I had uploaded in our Mediawiki (once upon a time) in the past. There are over a few thousand .mp3 files which I have to delete and since I used $wgHashedUploadDirectory, these files are spread across various sub-directories on the server.

So my question is...

Is there a MediaWiki maintenance script or a specific Mediawiki plugin which allows to batch delete files that have been uploaded to a wiki? (I searched a lot but couldn't find a single one... which is why I'm asking you guys here)

Also, If there is no such plugin or script to automate this task, what would be the manual way to delete all the files cleanly from both the database and the webserver?

~ Arnab

Arnab vani (talkcontribs)

Hey guys... Any ideas or advice on how to deal with this?

~ arnab

Ciencia Al Poder (talkcontribs)
Arnab vani (talkcontribs)

Okay, awesome this worked like charm. Thanks @Ciencia Al Poderfor taking the time to help me out here.