Manual:Block and unblock

Sysops can block and unblock IP addresses, and registered user accounts if username blocking is enabled (see below).

Blocking
Blocks are applied via the form at the special page Special:Blockip. There are several steps to applying a block:


 * 1) Specify the IP address or user to be blocked. Enter the IP address to be blocked, or the name of the registered user account to be blocked, in the "User" field of the form. Note that nonexistent usernames can also be blocked, so be certain you have the correct username. You can also block a range of IP addresses; see range blocks for instructions.
 * 2) Specify a duration for the block. You can select a predefined duration from the drop down box labelled "Expiry", or you can enter a custom value, using the GNU standard format, in the "Other time" field. If the duration given is "indefinite", then the block will not expire, although the IP address or user account may still be unblocked by a sysop.
 * 3) Specify a reason for the block (optional). This reason will be displayed to the blocked user if they attempt to edit a page.

Click "block this user" to apply the block. All blocks are recorded in the block log, and all currently active blocks are listed at the list of active blocks.

Note that in addition to manually entering the IP address or user account to be blocked into Special:Blockip, you may also follow the "Block this user" link from the toolbox in the sidebar when viewing the "User" or "User talk" page of the IP address or user account. You can also click on the "block" link next following an IP address or user account name in the recent changes list.

Blocking options
Several extra blocking options were added in version 1.8 of MediaWiki, which are enabled by checking a checkbox on the blocking form.


 * Block anonymous users only: This option changes the effect of a block when blocking an IP address. When it is enabled, the block will only affect anonymous users editing from that IP address; registered users editing from that IP address will not be affected. The option has no effect on a block of a registered user.


 * Block account creation: This option changes the effect of a block when blocking a user or an IP address. When it is enabled, the registration of new user accounts from that IP address will be disabled while the block is in effect.


 * Automatically block the last IP address used by this user, and any subsequent addresses they try to edit from: This option changes the effect of a block when blocking a registered user account. When it is enabled, the IP address most recently used by the account, and any IP addresses that the account subsequently attempts to edit from will be automatically blocked.

Unblocking
An IP address or registered user account can be unblocked via the list of active blocks. Find the IP address or registered user account you wish to unblock in the list (you can enter the address or name in the "search" field to help you find the entry), and click the "Unblock" link displayed to the right of the block's expiry time.

This will lead you to a confirmation page. Enter the reason for unblocking (optional) in the "reason" field, and click "unblock this address" to remove the block. All unblockings are recorded in the block log.

Note that if a range is blocked, then the unblock must cover the whole range to be effective. Attempting to unblock an individual IP address in the range will not be effective.

Enabling username blocking
The ability for sysops to block registered user accounts is enabled by default since version 1.4.1. It can be switched on by modifying LocalSettings.php to add the following line:

$wgSysopUserBans=true;

or switched off by adding:

$wgSysopUserBans=false;

If a sysop tries to block a registered user account and this setting is not enabled, then an error message will be displayed, informing the sysop that the "IP Address does not exist".

Enabling IP range blocking
The ability for sysops to perform range blocks is enabled by default since version 1.4.1. It can be switched on by modifying LocalSettings.php to add the following line:

$wgSysopRangeBans=true;

or switched off by adding:

$wgSysopRangeBans=false;