Changing All WordPress User Passwords At Once

Bill Cat loves SQL queriesBill Cat loves using SQL queries to get the job done.

I love WordPress a lot. I love Power Apps a lot. When you put the two together, IT IS MAGIC.

This situation was such a head scratcher for more than a minute. Now, I would never do this in a typical situation, but this wasn’t a typical situation for a client…

We built a portal for a client that is an awards redemption website. They log in, see their awards they’ve won, make any necessary changes on shipping address and submit!

The unique request from from my client’s client: we need the logins to be the client ID that is assigned by their own systems, not an email address. OK, no problemo, that’s no big deal. When any login is created from Power Apps, it syncs it with WordPress with whatever the password that gets typed in the form.

I AM GETTING TO THE POINT — JUST BE PATIENT.

This year, the client wanted all the passwords reset to a new password. So, how to do that?!

There are other plugins out there, but either they are overkill or so poorly rated that I don’t trust them AT ALL. If you search for this on your favorite search engine, one plugin always keeps coming back in the results and it has pretty awful reviews.

No thanks.

Back to the basics: a SQL query can do it all.

All you have to do is go to your phpMyAdmin on your hosting company’s portal and run a simple SQL query on the users table.

Make sure to take a backup before doing this because it’s not reversible. The passwords are encrypted, so after the UPDATE statement runs, you’re out of luck.

Here’s the statement to update everyone:

UPDATE 'wp_users'
SET 'user_pass' = MD5('thenewpassword')

Note: your Users table might have a different prefix than “wp_.”

Another note: the password needs to be inside the MD5() function. Once the user logs in for the first time, the password will be reencrypted in a stronger hash than that.

Now you’ve just reset all your user passwords.

Leave a Comment

Your email address will not be published. Required fields are marked *