I needed to delete all of the subscriber level users on one of my sites recently, and couldn’t find an easy way to do it. My solution? Write some code. It was definitely quicker and easier to run this snippet than to manually delete over 7,700 users from my database. Drop this code into an admin page where you can run it as an administrator, and watch it go to work!
If you need to delete authors, editors, or some other role, simple switch “subscriber” on line 3 to your chosen role. Note: it must be a valid WordPress role registered in your site. This code leaves users with posts in the database. If you would like to remove users that have posts, remove the conditional on line 7 and it’s corresponding closing bracket on line 13. Be sure to modify the wp_delete_user function call on line 8 with it’s second argument – this will keep those user’s posts online and attribute them to whatever user ID you specify in the second argument.
Disclaimer: This code is fast and aggressive. There is no “undoing” this operation. Use this at your own risk, data is NOT recoverable. Also, don’t believe everything you read online … you cannot perform the same function with raw MySQL without completely hosing your database – so don’t even try unless you REALLY know what you’re doing.
I just created shot these photos, created the gallery, and published to the site in less than 60 seconds total with the AutoMedia application. I’ve been working on the server-side plugin and have added a few new features that I think you’re going to like. The most dramatic change is the addition of the AutoGallery functionality that I promised six months ago. It’s working quite well, and this gallery should be proof enough of that. I’ll be committing the changes to the WordPress SVN after some further bug testing. Have a good weekend everyone!
I’m officially setting a long-term goal for myself: In 20 years, when my son and any future children we have are grown enough to be on their own, I’m going to hike the Appalachian Trail. The whole thing.
The weather was beautiful so we spent a day on the ICW looking for some fish and just cruising. It might be our last trip out for this year, as I’m going to be removing and rebuilding the engine soon!
As I stood in line to vote this morning with Tina, a new US citizen and first-time voter, she stated “In my country we didn’t have voting, we had genocide.” If that doesn’t make you proud to be American there’s something wrong with you. I am so happy to have been a part of that experience with her and share in her excitement. Good luck to all candidates and may the best man win!
Greetings from beautiful Palm Beach, FL once again!
Tina and I spent some quality family time in Daytona Beach over the weekend where we attempted to catch catfish, ate lots of food, and went cruising on Grace. This was especially exciting for me because after all the adventures I’ve had with them aboard Grace, I’ve never actually been out on the water on her.
So here’s our photo-journal of the weekend:
From the bridge of Grace
Pregnant Tina and Grandma Milka
Me, Grandma Milka, and Tina
And here’s a video from Silvana of our trip aboard Grace: