Title: WP_User-&gt;remove_role wrong &#8212; code change
Last modified: August 19, 2016

---

# WP_User->remove_role wrong — code change

 *  [javalizard](https://wordpress.org/support/users/javalizard/)
 * (@javalizard)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/wp_user-gtremove_role-wrong-code-change-1/)
 * Can someone _please_ update the code in capabilities.php from this
 * >  if ( empty($this->roles[$role]) || (count($this->roles) <= 1) )
 * to this:
 * > if ( empty($this->caps[$role]) || (count($this->caps) <= 1) )
 * It’s on line 202 of version 2.6.2 capabilities.php. This issue has been around
   for a very long time and it’s stopping me from removing a role from a user.
 * Can someone take a few moments and update this one line of code?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 7 months ago](https://wordpress.org/support/topic/wp_user-gtremove_role-wrong-code-change-1/#post-880964)
 * If this is a bug, you should post it on [the bug tracker](http://trac.wordpress.org).
 * All code changes go through there.
 *  Thread Starter [javalizard](https://wordpress.org/support/users/javalizard/)
 * (@javalizard)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/wp_user-gtremove_role-wrong-code-change-1/#post-881324)
 * It’s now on line 568 of capabilities.php in version 2.7.
 * I tried adding a bug to the tracker but it didn’t let me.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WP_User->remove_role wrong — code change’ is closed to new replies.

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 2 replies
 * 2 participants
 * Last reply from: [javalizard](https://wordpress.org/support/users/javalizard/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/wp_user-gtremove_role-wrong-code-change-1/#post-881324)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
