PHP script to add WordPress admin user

I recently needed to add a new administrator username to a WordPress install.

Doing this manually via SQL is not the most difficult task in the world, but it can be quite a challenge as it requires special access (either to mysqladmin or something like phpMyAdmin) and SQL knowledge.

Plus there’s a always room for error when messing around with SQL data.

To use the script, just upload it to your WordPress root folder and access it via the browser. And remember to remove it after using it as it is an extreme security risk if left live there for anyone else to use it and add an administrator username to your site.

Download the script from here, or copy-paste the code below.