Skip to content

Kirby 4.3.0


Updates the user data

$user->update(?array $input = null, ?string $languageCode = null, bool $validate = false): Kirby\Cms\User


Name Type Default
$input array|null null
$languageCode string|null null
$validate bool false

Return type


This method does not modify the existing $user object but returns a new object with the changes applied. Learn more →

Parent class



try {

    'firstName' => 'Bastian',
    'lastName'  => 'Allgeier'

  echo 'The user has been updated';

} catch(Exception $e) {

  echo 'The user could not be updated';
  // optional reason: echo $e->getMessage();


This method only updates the content in the user.txt file. To update the user email or the user name, use the $user->changeEmail() or $user->changeName() methods.