Resetting admin password via API
For some reason, you have managed to lock yourself out of a site you are currently developing.
Paste the following into a file (e.g. "reset.php") in the root folder of the site, then run it.
ProcessWire version >= 2.6.9
require "index.php"; $admin = $users->get('admin'); // or whatever your username is $admin->setAndSave('pass', 'yo123456');
ProcessWire version < 2.6.9
require "index.php"; $admin = wire('users')->get('admin'); $admin->setOutputFormatting(false); $admin->set('pass', 'yo12345'); $admin->save('pass');
View/correct recipe on GitHubhttps://github.com/processwire-recipes/Recipes/blob/master/resetting-admin-password-via-api.md
- Nico Knoll