Bots are automated external software tools that can be used to perform tedious work or certain repetitive tasks related to a wiki. The code of bots calls the MediaWikiAPI in order to make changes on the wiki.
Bots can be used for helpful purposes, such as fixingdouble redirects, or anIRC RC Bot can post recent changes to your wiki on an IRC channel.Bots can also be used for harmful purposes, such as vandalism and spamming (see alsoCombating spam).
WP:CREATEBOT on English Wikipedia lists many bot frameworks, written in various programming languages.
Because a bot can make hundreds or even thousands of edits per hour or minute, thus flooding recent changes,user rights should be configured to allow bots to be given a special user right that will prevent their edits from appearing in the default recent changes feed.As this could cause thousands of incorrect or malicious bot edits to go unnoticed for a long time, this right should only be given to bots operated by trusted users.
This is the right that grants a user account the ability to perform an edit with a "bot" flag.
bot" permission may also be temporarily granted to human editors flooding Recent Changes (e.g. usingAutoWikiBrowser).The "bot" user group is available in MediaWiki by default to grant a user account the bot right. This is because user management goes by groups, not rights.To grant a user account the bot right, add the user account to a group that provides that right.
SeeAPI:User group membership for the API to add a user account to the bot group.
The "bot" flag is the only reliable factor to identify a bot edit.This indicates most accurately that the edit was intended as bot edit (and that the user could do so because they had the bot user right when the edit was made).
It is especially reliable because the data is stored with the edit, not calculated afterwards, so it isn't affected by the user's group memberships at query time.
However it has one catch: The data is only stored in therecentchanges table, from which it expires after the amount of time configured through$wgRCMaxAge.This may be why this best way is also the least common way to categorize bot edits in analytics (unless only covering recent data).
In the future, the bot flag might be stored in therevision table, thus making it permanently available (T19237).