Jump to navigation Jump to search
Available from version 1.22.0
Occurs immediately before a file or other page is moved
Define function:
public static function onTitleMove( Title &$title, Title &$newtitle, User &$user ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"TitleMove": "MyExtensionHooks::onTitleMove"

For MediaWiki ≤1.25:

$wgHooks['TitleMove'][] = 'MyExtensionHooks::onTitleMove';
Called from: File(s): Title.php
Function(s): Title::moveTo()

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

This hook is in Title::moveTo(), which is called from SpecialMovepage.php and ApiMove.php.


  • $title: old Title
  • $newtitle: new Title
  • $user: User who is doing the move

See also[edit]