Hi @corrinarusso
The link does not have any PHP/WordPress code to delete all subscribers. It has plugins and the manual way, and none of them work for me.
Thanks.
The safest way to do this is using the cli, like this :
wp user delete $(wp user list --role=subscriber --field=ID) --reassign=1
https://developer.ww.wp.xz.cn/cli/commands/user/delete/
Make sure you backup first, but you could use some SQL like this :
DELETE wu FROMwp_users` wu
INNER JOIN wp_usermeta ON wu.ID = wp_usermeta.user_id
WHERE meta_key = ‘wp_capabilities’ AND meta_value
LIKE ‘%administrator%’`
Make sure you run a select before a delete just to be sure you have the data you want.