You can for example add this:
foreach( array( 'tools', 'import', 'export' ) as $x )
{
add_action( "load-{$x}.php", function()
{
if( ! current_user_can( 'manage_options' ) )
wp_die( __( 'No access!' ) );
} );
}
to restrict access to the {tools,import,export}.php
pages for non-admins.
Related Posts:
- How to disable the “Post Lock/Edit Lock”?
- How can I control the position in the admin menu of items added by plugins?
- How to remove screen options and help links in the admin area?
- Check if user is admin by user ID
- Unable to login to my wordpress site. reauth=1 redirection loop
- wp_list_tables bulk actions
- Highlight custom widgets in the admin area?
- How do I find all admin users using phpmyadmin?
- Can I add custom attributes while adding inline scripts?
- create users to site with specific language
- Hide a page in the admin end without a plugin?
- Prevent from deleting any user role but subscriber
- Disable sticky posts feature
- Hide username from users list
- Remove HTTP: from the site URL and just keep // in it
- Prevent Admin gui output from page added using add_submenu_page
- Activating Child Theme Breaks Website, Blank Page, Error 500
- Create Read Only Admin
- wp-admin blank in a clean install of WordPress on PHP 5.4 [closed]
- wp-admin is redirecting to back to home page (localhost)
- Rename W3 Total Cache admin menu
- WP Database Error (Windows Server 2008 & SQL Server)
- Cloned a site but can’t log in – redirecting to old site
- Can I edit the wp_post > post_content right before its inserted/updated?
- Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?
- wp-admin edit user url wont show up correct url [closed]
- Which HTTP headers to use for subdomain embedding?
- FORCE_SSL_ADMIN not working
- I get “The PHP Date/Time library is not supported by your web host.” on my CentOS host, what library to I need to install to add support?
- How can I allow core, plugin, theme update checks only for selected admins?
- wp_before_admin_bar_render action not working in back office
- Can enter wp-admin when logged in with custom ajax
- Locked Out Of WordPress Admin Dashboard After Server Move
- lock meta box position on post edit screen for contributors
- Subscribers become Authors after Upgrade? / Mass Update of Users?
- map_meta_cap was called incorrectly error?
- How do I host WordPress on a hidden domain through a reverse proxy?
- Clicking On View Post In Draft Opens New Tab
- How to set admin login page as home page
- Redirect loop in /wp-admin/
- Modify WP-Admin login fields
- Create custom fields as image uploads [duplicate]
- Created a new subdomain with same content. Should I add a redirect in my old subdomain?
- Placing a custom Control element in an existing block InspectorControls panel
- What are the requirements to make the admin toolbar show up on the front end
- Sorry, you are not allowed to access this page
- wp-admin folder removed by hacker [closed]
- Cannot Access wp-admin as redirects to wp-signup.php?
- Hide username discovery
- Cookie Domain is preventing Admin login
- How to use the built in tooltip for form validation error messages in WP admin plugin?
- _wpnonce blank screen
- Lost administrator privileges and can’t find a fix
- How to display site title with post title?
- Cant login to wp-admin
- Restrict submitters from wp-admin [duplicate]
- How change a core block label
- Cannot redeclare wp_update_core()
- WP-admin or any other is redirecting me to (This page doesn’t seem to exist.)
- Remove WP Admin Menu Items by User Role
- Adding a button to send email to a user in WordPress Admin Users table
- Restrict access to admin-post.php
- Our Team not showing on website [closed]
- How do I add something to the “Edit Tag” page in wp-admin?
- Get current session in WP admin
- Strange problem with HIdden Input field and WPAlchemy
- Uncaught SyntaxError: Unexpected Token Illegal
- How to remove the Login Customizer menu from the WordPress dashboard
- How to add a field on the user creation page?
- Change the default Post/Page edit title in Admin
- Detail view for an element in a list the admin site
- Login redirect_to url is pointing to a url with the port
- data-vocabulary.org schema
- Accessing wordpress tool in local MAMP Site
- Unable to access my page or WP Admin
- Get current URL in Form action
- My WP-Admin is showing a blank screen
- How to move “Collapse Menu” to top of admin bar?
- Appearance -> Menus doesn’t show
- wp-admin ERR_CONNECTION_TIMED_OUT only on certain networks
- Show comments in Backend
- How to hide comments from private posts on user dashboard
- Conditions for admin get_current_screen action parent_file edit.php?post_type=page
- Replace whole paragraph on multiple pages
- Error establishing a database connection – after updating DNS
- Messed something up, and now I can’t get into wp-admin
- Handling multiple account logins?
- Admin section showing CUSTOM Permalink structure thus resulting in permission error [closed]
- Hook into backbone to add js to wp-admin -> media library?
- Moved from WP.Domain to Primary Domain, Can’t Login
- Trying to use and understand JSON API and get_posts
- Search box for hierarchical taxonomies in admin interface
- Custom Admin Message from external source to multiple users
- Customize a WP_Posts_List_Table class
- How can visitors redirect wp-admin to the homepage?
- Help please i cant login to wordpress panel [closed]
- Redirecting the user to the admin table area after publishing a post, getting an invalid response error?
- How can you change the admin dashboard URL without symlinking?
- Degraded WordPress admin dashboard performance [closed]
- WordPress Localhost migration issue