brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp user list --role=administrator shows who can do everything

Security
~/tips/tip-wordpress-user-list-administrators

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered

Lists every administrator account of a WordPress site with only the columns you pick.

Every administrator account on a WordPress site is a full key to it. I like to look at that list now and then, and wp user list does it faster than clicking through the Users screen.

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered

You get a table with just those columns. Without --fields the default set is ID, login, display name, email, registration date and roles. Add --format=csv or --format=json if you want to keep the result or feed it to another tool.

Read the list the way you would read a list of house keys. An old developer account, a test user nobody remembers, an address you do not recognise: those are worth a closer look. Check the registration dates too, since an administrator created at an odd moment is a classic sign of a break-in.

When something does not belong, you can demote it before you delete it:

wp user set-role 7 subscriber

Replace 7 with the real ID. Deleting a user with wp user delete can reassign or remove their posts, so I would demote first and delete later.

The caveat: the list only shows accounts with the administrator role. A plugin can add its own roles or capabilities, so a user with another role can still be powerful. On multisite, add --network to include the whole network.

Further reading: wp user list (WP-CLI handbook)

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link