Manual:cleanupSpam.php
MediaWiki version: | ≥ 1.6 |
MediaWiki file: cleanupSpam.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.43.0 • 1.42.4 • 1.39.11 |
Classes: | CleanupSpam |
Details
editcleanupSpam.php file is a maintenance script to cleanup all spam links, which are pointing to a given hostname. The script will use the username, which has been provided in MediaWiki:Spambot username to attribute the resulting edits to. The script checks each of the respective wikis for external links to the given hostname. In case a page contains a link to that host, the script goes backwards in the history of the page, until the host is no longer on the page. The script will then revert the page to that revision.
Options/Arguments
editOption/Argument | Description | Required? |
---|---|---|
<hostname> | Hostname that was spamming and that you want to get rid of (e.g. google.com). A single * wildcard in the beginning is allowed. For example: php maintenance/cleanupSpam.php google.com
|
Optional |
--all | Check all wikis in ($wgLocalDatabases ). With this option, the script will loop through all of these wikis. Without --all , it will check the current wiki only.
|
Optional |
--delete | If a page does not have any revision without the spammy hostname, the script by default blanks that page. If --delete is provided, it instead deletes the according pages.
|
Optional |
Usage
editphp maintenance/run.php cleanupSpam <hostname> [ --all| --delete ]
Terminal
$ php maintenance/run.php cleanupSpam example.com Found 2 articles containing example.com MediaWiki:Menubar ....blanking Main_Page ...blanking
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.