How to Remove WordPress Dashboard Access for Non-Admins

The WordPress dashboard can be confusing for users who don’t have any business being there. Remove Dashboard Access for Non-Admins is a new plugin that keeps users out of the dashboard. If a user does not have the ‘delete_themes’ capability, he will be redirected to your site’s homepage.

In the future, the plugin author plans to add in the option for you to select the capability type by which to remove access to the dashboard. Download Remove Dashboard Access for Non-Admins from the WordPress plugin repository.

Featured Plugin - WordPress Membership Site Plugin

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - WordPress Wiki Plugin

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - WordPress Appointments Plugin

Take, set and manage appointments and client bookings without having to leave WordPress. Appointments+ makes it easy.
Find out more

Featured Plugin - WordPress Facebook Plugin

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - WordPress Pop-Up Chat Plugin

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - WordPress Q&A Site Plugin

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - WordPress Google Maps Plugin

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - WordPress Newsletter Plugin

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Comments (8)

  1. Hello
    Did you test it ?

    All ajax requests from front-end are dead.
    The code is using : $_SERVER['DOING_AJAX']
    PHP and WORDPRESS do not even care about that.
    $_SERVER['DOING_AJAX'] will never contain any string/url/thing.

    So, i’m a visitor, i clic on a ajax link (a Like button, linked to back end), the ajax will return me the entier html code from the home page. Just “whoaw”.

  2. So, this works – but how users can create new posts?
    I want that they can create new posts and the editor for this post is inside of my theme (inside of my website)…any ideas ? thanks a lot!

  3. Hello,

    In my case this code

    if (!current_user_can(‘edit_published_posts’) && $_SERVER['DOING_AJAX'] != ‘/wp-admin/admin-ajax.php’) { wp_redirect(site_url()); exit; }

    not worked, the ajax request url is getting redirected to home page for a non-logged in/Non admin users.

    So I have changed the condition to this, and its fine now.

    if (!current_user_can(‘manage_options’) && (empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != ‘xmlhttprequest’) ) {
    wp_redirect(home_url()); exit;
    }

    Any way Great idea.

    Thanks
    Jaseem

Participate