12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Aug 11, 2019

Access Control for WP Admin Pages PRO

Sridhar Katakam

Below are the possible ways in which access can be restricted to admin pages built with WP Admin Pages PRO (plugin coverage here).

1. When editing the Admin page

Add New screen of Admin Pages has a Permissions tab in the Advanced Options meta box.

Here you (admin) can check the roles that should have access to edit the admin page.

Details here.

It is also possible to limit access by usernames. See this KB article.

2. Screen Options

You can log in using the user’s account that should not see “Admin Pages” menu in the WP admin, then pull down Screen Options from the top right and uncheck ‘Display the “Admin Pages” menu item?’.

One problem with this approach is that if your client is tech savvy enough or like the curious George, he/she may reverse this setting, then see the Admin Pages menu item and mess things up to their heart content.

The next method addresses this problem.

3. Using a Filter

Adding the following using the Code Snippets plugin will ensure that the above Screen Options method does not function – meaning, only the admins will be able to access the Admin Pages admin menu.

add_filter( 'wu_apc_should_display_admin_menu', '__return_false' );

KB article regarding the last two methods is here.