Open main menu


< Manual:Hooks
Available from version 1.5.8
Removed in version 1.33.0
Can be used to cancel user account creation
Define function:
public static function onAbortNewAccount( User $user, &$message ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"AbortNewAccount": "MyExtensionHooks::onAbortNewAccount"

For MediaWiki ≤1.25:

$wgHooks['AbortNewAccount'][] = 'MyExtensionHooks::onAbortNewAccount';
Called from:File(s): specials/SpecialUserLogin.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:AbortNewAccount extensions.


  • $user: the User object about to be created (read-only, incomplete)
  • $message: out parameter: error message to display on abort


  • Return false to cancel account creation.