Delete all users with Editor role and their content mysql

It’s a three step process.

  1. First, get a list of Editors using WP_User_Query.

  2. Get a list of each user’s posts using get_posts and delete them using wp_delete_post.

  3. Lastly, delete the user itself using wp_delete_user.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)