Hello, I followed the code example about prohibit access to admin, but recently, this function may redirect Admin to the home page, some plugins added roles disappeared sometime, some plugin tabs on the navigation bar were also disappeared, I noticed that you have remove this code from this article, that means you may have known this bug? Thanks
Code is still available at the mentioned article. It does not remove any roles and/or admin menu items.
Check if this option checkbox is not turned ON accidentally for the ‘administrator’ role.
Refresh your site caching support (plugins and system routine, like CDN, etc.).