Manual:Block and unblock

admins>Special:MyLanguage/Manual:Administrators|Sysops can block and unblock IP addresses (and registered user accounts if username blocking is enabled) from editing, uploading files, moving>Special:MyLanguage/Help:Moving a page|moving pages, and, if they have been granted such rights, protecting/unprotecting and deleting/undeleting pages.

Blocking
Blocks are applied via the form at the special>Special:MyLanguage/Help:Special pages|special page Special:Block.

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 "" 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  for instructions.
 * 2)  Specify the parameters of the block.  Select the actions that the block target should be prevented from completing.  A  block prevents the block target from editing all pages on the wikis, while a  block prevents the block target from editing the specified pages and/or pages inside the specified namespaces.
 * 3)  Specify a duration for the block.  You can select a predefined duration from the drop down box labelled "", or you can enter a custom value, using the [http://www.gnu.org/software/tar/manual/html_node/Date-input-formats.html</> 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.
 * 4)  Specify a reason for the block (optional).  This reason will be displayed to the blocked user if they attempt to edit a page.

Click "<tvar|block></>" to apply the block.

All blocks are recorded in the log>Special:Log/block</>|block log, and all currently active blocks are listed at the blocklist>Special:BlockList</>|list of active blocks.

Note that in addition to manually entering the IP address or user account to be blocked into <tvar|special>Special:Block</>, you may also follow the "<tvar|block></>" link from the toolbox in the bar>Special:MyLanguage/Manual:Navigation bar</>|sidebar when viewing the "User" or "User talk" page of the IP address or user account.

You can also click on the "<tvar|block></>" link next following an IP address or user account name in the recent>Special:RecentChanges</>|recent changes list or the page history.

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

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.
 * Block anonymous users only (also called softblocking) : 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, but does on an autoblock caused by it.
 * 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 (also called hardblocking) : This option changes the effect of a block when blocking a registered user account.

Partial blocks
Since MediaWiki 1.33, it is possible to prohibit the block target from making changes only to the specified pages and/or all pages in namespaces.

If a page is moved, the restriction will be switched to the new title.

Currently non-existent ("redlink") pages cannot be blocked, and setting multiple overlapping blocks with different expiration dates is not supported.

In MediaWiki 1.33 and 1.34, partial block is disabled by default.

It may be enabled by setting <tvar|1> </>.

Since MediaWiki 1.35, partial blocks are always enabled and cannot be disabled.

You may hide partial blocks form elements by adding some JS or CSS to user or site <tvar|1>common.js/common.css</>.

This does not disable partial blocks which may still be set via API.

Unblocking
An IP address or registered user account can be unblocked via the special>Special:Ipblocklist</>|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 "<tvar|search></>" field to help you find the entry), and click the "<tvar|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 "<tvar|reason></>" field, and click "<tvar|unblock></>" to remove the block.

All unblockings are recorded in the log>Special:Log/Block</>|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.

Effects of being blocked
Blocked users may still read pages, but they may not create, edit or move pages, or upload files.

Partially blocked users may not edit the particular pages or namespaces specified in their block, but may create, edit or move other pages, and may upload files.

Users with certain other rights>Special:MyLanguage/Help:User rights</>|user rights may not be able to use those rights when they are blocked, depending on their block.

For example, users with the rights to delete and undelete or protect and unprotect pages will not be able to do so if they are sitewide blocked.

If they are partially blocked, then for any page they are not blocked from, they will still be able to perform these actions.

However, users with the rights to block and unblock users will still be able to do so when they are blocked, including any blocks on their own account, given that they have the  right.

Users who are blocked and attempt to edit a page (or move a page, or upload a file) will see the blockedtext>MediaWiki:Blockedtext</>|"Your account or IP address has been blocked" message informing them that they have been blocked.

If the autoblock>Special:MyLanguage/autoblock</>|autoblock option has been enabled with respect to a block, and the blocked user attempts to edit (or move a page, or upload a file), the IP address being used by that user will also be blocked.

Configuration settings related to blocking
The configuration options below can be set in <tvar|LocalSettings></> and can be used to enable or disable certain aspects of the blocking interface.
 * - controls how many seconds need to pass until a block on an "autoblocked" IP address will expire. The default is 86400 seconds (one day)
 * - controls whether or not a blocked user is able to edit their own user talk page. This is currently (1.26+) true by default.  The ability to disable the ability of a blocked user to edit their own user talk page, when this variable is true, is an option available in <tvar|special>Special:Block</>.
 * <tvar|1> </> and the blockemail 2>Special:MyLanguage/Manual:User rights</>|user right control the ability for sysops to prevent users from using the <tvar|3>Special:EmailUser</> interface.  <tvar|SysopEmailBans> </> is true by default.
 * - controls if blocked users will be allowed to login. This is false by default.
 * - (1.29+) determines whether to set a cookie when a user is autoblocked. Doing so means that a blocked user, even after logging out and moving to a new IP address, will still be blocked.  This is false by default.
 * - (1.33+) - allow the creation of partial blocks, which can block a user account, IP address or IP range from particular pages, namespaces or actions. This is false by default.


 * The hideuser user right controls the ability for sysops to prevent a blocked user from appearing in the block log, the active block list, and the user list.

MediaWiki: pages

 * MediaWiki:ipboptions - contains a list of suggested block durations
 * MediaWiki:ipb-default-expiry - allows customization of the default duration in the blocking form (if left unchanged, the default duration is "other")
 * More blocking-related interface messages

URL parameters
Special:Block accepts some URL parameters to prepopulate the HTML form:


 * - username/IP address
 * - the type of block restriction (<tvar|1>=sitewide</> or <tvar|2>=partial</>)
 * - the pages to block (only applies for partial blocks; separate multiple pages with <tvar|1>%0A</>; maximum 10 pages)
 * - IDs of the namespaces to block (only applies for partial blocks; separate multiple namespaces with <tvar|1>%0A</>; see <tvar|2></> for a list of blockable namespace IDs)
 * - expiry time
 * - autoblock>Special:MyLanguage/autoblock</>|autoblock setting (=1 or =0)
 * - hard block setting (=1 or =0)
 * - prevent account creation (=1 or =0)
 * - reason, from selection of <tvar|dropdown>MediaWiki:Ipbreason-dropdown</>
 * - prepopulating "other reason" text field

Hooks

 * - occurs whenever the software receives a request to block an IP address or user
 * - occurs after the request to block an IP or user has been processed
 * - fired after the user's getBlockStatus is set