Disable Dashboard access for users of a specific role or capability. Disallowed users are redirected to a chosen URL. Get set up in seconds.
The easiest and safest way to restrict access to your WordPress site’s Dashboard and administrative menus. Remove Dashboard Access is a lightweight plugin that automatically redirects users who shouldn’t have access to the Dashboard to a custom URL of your choosing. Redirects can also be configured on a per-role/per-capability basis, allowing you to keep certain users out of the Dashboard, while retaining access for others.
Blocking access to the Dashboard is a great way to prevent clients from breaking their sites, prevent users from seeing things they shouldn’t, and to keep your site’s backend more secure.
Allow only users with roles or capabilities:
You can restrict Dashboard access to Admins only, Editors or above, Authors or above, or by selecting a specific user capability.
Grant access to user profiles:
Optionally allow all users the ability to edit their profiles in the Dashboard. Users lacking the chosen capability won’t be able to access any other sections of the Dashboard.
Show a custom login message:
Users lacking the chosen capability or role(s) will be redirected to the URL set in Settings > Dashboard Access.
The Toolbar contains certain important links (even for disallowed users) such as for accessing to the profile editor and/or logging out. Plus, there are many plugins out there for disabling the Toolbar if you really want to.
No. Disable the plugin if you don’t wish to leverage the functionality.
rda_toolbar_nodes
(viewing from the admin), and rda_frontend_toolbar_nodes
(viewing from the front-end).<li>
container for the menu node you’re targeting. It should take the form of <li id="wp-admin-bar-SOMETHING">
<li id="wp-admin-bar-SOMETHING">
, you want the “SOMETHING” part.The function returns an associative array with $pagenow
as the key and a nested array of key => value pairs where the key is the $_GET
parameter and the value is the allowed value.
Example: If you want to allow a URL of tools.php?page=EXAMPLE
, there are three parts to know:
$pagenow
global value (tools.php
in this case)$_GET
key (page
in this case)$_GET value (
EXAMPLE in this case)Here is how we would add that URL to the allowlist:
/** * Allow users to access a page with a URL of tools.php?page=EXAMPLE * * @param array $pages Allowed Dashboard pages. * @return array Filtered allowed Dashboard pages. */ function wpdocs_allow_example_dashboard_page( $pages ) { // If the $pages array doesn't contain the 'tools.php' key, add it. if ( ! isset( $pages['tools.php'] ) ) { $pages['tools.php'] = array(); } // Now add `?page=EXAMPLE` combination to the allowed parameter set for that page. $pages['tools.php'][] = array( 'page' => 'EXAMPLE' ); return $pages; } add_filter( 'rda_allowlist', 'wpdocs_allow_example_dashboard_page' );
/** * Filter hidden Toolbar menus on the front-end. * * @param array $ids Toolbar menu IDs. * @return array Filtered front-end Toolbar menu IDs. */ function wpdocs_hide_some_toolbar_menu( $ids ) { $ids[] = 'SOMETHING'; return $ids; } add_filter( 'rda_frontend_toolbar_nodes', 'wpdocs_hide_some_toolbar_menu' );
Common plugin Toolbar menus and their ids:
To view debugging information on the Settings > Reading screen, visit:
example.com/options-general.php?page=dashboard-access&rda_debug=1
Yes! This plugin is in active development on GitHub. Pull requests are welcome!
Yes. The plugin does not collect any personal data, nor does it set any cookies.
rda_allowlist
, to configure pages that should be accessible to all users, regardless of their capabilities or roles (see FAQ for usage)ABSPATH
(#26)index.php
files in plugin directoriesRemove Dashboard Access is now being maintained by TrustedLogin! Remove Dashboard Access aligns with what we do at TrustedLogin: simply making WordPress more secure. Email any questions to [email protected].
screen_icon()
warning$pagenow
global is not defined (#24)Invalid argument supplied for foreach()
PHP warning (#22)Bug Fix:
Enhancements:
rda_default_caps_for_role
– Filter default roles for Admins, Editors, and AuthorsBug Fixes:
rda_default_access_cap
– Change default access capabilityrda_toolbar_nodes
– Filter which back-end Toolbar nodes are hiddenrda_frontend_toolbar_nodes
– Filter which front-end Toolbar nodes are hidden