Title: Protect admin &#8216;bug&#8217;
Last modified: December 17, 2019

---

# Protect admin ‘bug’

 *  [jillebehm](https://wordpress.org/support/users/jillebehm/)
 * (@jillebehm)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/protect-admin-bug/)
 * Hi there,
 * when working with your plugins I found a ‘bug’ in the protect-admin class.
    In
   the function exclude_administrators() it searches for ‘%administrator%’ in the
   usermeta capabilities. Since I have a custom role called ‘site_administrator’,
   it also hides those users. If you change ‘%administrator%’ to ‘%”administrator”%’(
   with the double quotes), it works in the correct way. As far as I know this should
   be possible to use, since the role is in the database with “” around it because
   of the serialize.

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

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/protect-admin-bug/#post-12248861)
 * Hi,
 * You are correct. Thank you for the suggestion. I will include this fix into the
   next update.
 * I have knew about a problem with roles containing ‘administrator’ inside ID. 
   And I wonder how I missed this simple fix for years.
 *  Thread Starter [jillebehm](https://wordpress.org/support/users/jillebehm/)
 * (@jillebehm)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/protect-admin-bug/#post-12254223)
 * Hi Vladimir,
 * great! Glad I could be of assistance 🙂

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

The topic ‘Protect admin ‘bug’’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jillebehm](https://wordpress.org/support/users/jillebehm/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/protect-admin-bug/#post-12254223)
 * Status: not resolved