Manual:cleanupSpam.php

From MediaWiki.org
Jump to: navigation, search

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎Nederlands • ‎polski • ‎português

Details[edit]

cleanupSpam.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.

Usage[edit]

php cleanupSpam.php <hostname> [--all] [--delete]
Option/Parameter Description
<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 cleanupSpam.php google.com
--all Check all wikis in ($wgLocalDatabasesManual:$wgLocalDatabases). With this option, the script will loop through all of these wikis. Without --all, it will check the current wiki only.
--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.

External links[edit]