• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

How to restrict an admin to access certain areas of Admin Dashboard without plugin

DarKMaSk

Well-known member
Nov 17, 2020
774
330
63
  • Title for your fault: Want to make a custom role to restrict an admin to access certain area
  • Fault Description: I am unable to create a Custom Role with which I can restrict an admin to access certain areas in Admin Dashboard of WordPress.
  • What have you done to try to fix the issue: I am not a coder but I do edit some code by Google-ing. I tried to make a MU-PLUGIN which remained unsuccessful. I tried to add functions in the site theme's functions.php file but could not make it work as per my desire.
  • What I want to do: I am building a hotel website with wordpress. Now, I have to give my client the admin access to manage the booking only. All menus / options on the left side panel will be inaccessible and hidden except the booking option. I prefer using a method which will not be destroyed / changed with the update of the theme. I have attached a screenshot with multicoloured markings and their explanations for better understanding. So far, I have successfully hide the rest of the menu / links / options on the left panel using some code in functions.php file of the theme I used but have failed to hide the red-marked area. Can you guys help me? Please guide me.

Reference image:

restrict-access.jpg
 
@aslam_1 and @xeric Friends, actually this thread had a long conversation with @frizzel which extended to 3 (three) pages where he guided me step by step and helped me by making a 'mu-plugin' to create a clean custom user dashboard and advised me to do the restriction part with a plugin 'Admin Menu Editor Pro' which I downloaded from here and it did the job. But unfortunately, that whole conversation is gone. How? I don't know. But there were some more codes which I didn't copied on good faith that those are here and I will be able to copy them when I will work on that part and that is my big loss. All of that is gone now. But, you know, mishap happens and this was my fault that I didn't copied all of them at the first place, though I copied the most important one, the 'mu-plugin'. Anyway, the problem has been solved. So, no need to spend your precious time on giving solutions for this one anymore. :)

Simplest solution that I know of: https://wordpress.org/plugins/controlled-admin-access/

Since it's open source freeware, you don't even need to pay for the functionality.

Why do you want to do it without a plugin?
Thanks for the info. I will surely give it a try. :)
 
Last edited:
Why do you want to do it without a plugin?
Friend, I am not very fond of plugins. More plugins mean more problems, you know why. I install only those plugins which are essential for the functionality. And in my site, there were already 17 plugins installed all of which are essential. That's why I didn't want to install anymore plugin. But as I am not very good at coding, I had to use that 'Admin Menu Editor Pro' plugin for imposing the restriction. Moreover I needed a clean customized dashboard with customized header and footer for the user / client. To solve that purpose @frizzel made a 'mu-plugin' and I copied it. But along the process, what he did, he taught me what is what in the code and that tutorial I am missing most because I did not copied them. Anyway, accident is accident and we have to live with the consequences. :(
 
Last edited:
  • Like
Reactions: ckeeper
O MY GOD!!! I LOVE YOU MY FRIEND !!! I thought it is gone forever!!! Oh! How can I thank you friend? As there is no 'Add Friend' option here, I am using 'Follow' option to add you as my friend. Thank you soooo much! ☺️😌🤗
 
  • Love
Reactions: Babak
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock