If you have ftp access you can create an admin user for yourself.
Have you ever been given FTP access to a WordPress website but not given an admin account? If you’ve experienced this unusual scenario then it’s easy to create an admin user for yourself.
I got this code from a site that does not appear to be around any more – https://wphub.me.
This code must be uploaded to the
wp-content/mu-plugins directory. Plugins in this directory are activate by default without you having to activate them – “Must Use Plugins”. Uploading the code into the usual
wp-content/plugins directory won’t work as you don’t have an account to login and activate it. Catch 22.
Like most of the code on this site, I think that it is quite simple. On page load the code checks whether the username exists or the email address has been used by any account. If both tests fail then a new account is created with the specified username, email address and password. The new account is then given the administrator role.
So, to use it, upload it to
wp-content/mu-plugins (creating the directory if necessary), load any page on the website to run the code. Then you can delete the file and login using the username and password that were in the file.