Title: Allow Admin Bypass Access?
Last modified: March 26, 2022

---

# Allow Admin Bypass Access?

 *  Resolved [davidblood](https://wordpress.org/support/users/davidblood/)
 * (@davidblood)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/)
 * Hi,
 * Is there any hooks or functionality to allow admins access regardless? I currently
   use [Administrator Access to PMPro Protected Content](https://en-gb.wordpress.org/plugins/administrator-access-to-pmpro-protected-content/).
   However, it seems to be broken in the recent update of Paid Memberships Pro has
   caused errors.
 * **Any plans to build this direct into Paid Memberships Pro**?
 *     ```
       [26-Mar-2022 14:17:11 UTC] PHP Warning:  Attempt to read property "roles" on string in /wp-content/plugins/administrator-access-to-pmpro-protected-content/class-adminOverride.php on line 143
       [26-Mar-2022 14:17:11 UTC] PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /wp-content/plugins/administrator-access-to-pmpro-protected-content/class-adminOverride.php:143
       Stack trace:
       #0 /wp-content/plugins/administrator-access-to-pmpro-protected-content/class-adminOverride.php(143): in_array()
       #1 /wp-content/plugins/administrator-access-to-pmpro-protected-content/class-adminOverride.php(112): E20R\PMPro\Access_Rights\adminOverride->adminAccessPermitted()
       #2 /wp-includes/class-wp-hook.php(307): E20R\PMPro\Access_Rights\adminOverride->shortcodeAccessPermitted()
       #3 /wp-includes/plugin.php(189): WP_Hook->apply_filters()
       #4 /wp-content/plugins/paid-memberships-pro/shortcodes/membership.php(84): apply_filters()
       #5 /wp-includes/shortcodes.php(356): pmpro_shortcode_membership()
       #6 [internal function]: do_shortcode_tag()
       #7 /wp-includes/shortcodes.php(228): preg_replace_callback()
       #8 /wp-includes/class-wp-hook.php(307): do_shortcode()
       #9 /wp-includes/plugin.php(189): WP_Hook->apply_filters()
       #10 /wp-includes/post-template.php(253): apply_filters()
       #11 /wp-content/themes/oceanwp/partials/page/article.php(20): the_content()
       #12 /wp-includes/template.php(772): require('/home/tlguzfgc/...')
       #13 /wp-includes/template.php(716): load_template()
       #14 /wp-includes/general-template.php(204): locate_template()
       #15 /wp-content/themes/oceanwp/partials/page/layout.php(20): get_template_part()
       #16 /wp-includes/template.php(772): require('/home/tlguzfgc/...')
       #17 /wp-includes/template.php(716): load_template()
       #18 /wp-includes/general-template.php(204): locate_template()
       #19 /wp-content/themes/oceanwp/page.php(36): get_template_part()
       #20 /wp-includes/template-loader.php(106): include('/home/tlguzfgc/...')
       #21 /wp-blog-header.php(19): require_once('/home/tlguzfgc/...')
       #22 /index.php(17): require('/home/tlguzfgc/...')
       #23 {main}
         thrown in /wp-content/plugins/administrator-access-to-pmpro-protected-content/class-adminOverride.php on line 143
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fallow-admin-bypass-access%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/#post-15501550)
 * Hi [@davidblood](https://wordpress.org/support/users/davidblood/)
 * Thank you for reaching out to Paid Memberships Pro.
 * This plugin is built by an independent developer, I recommend reaching out to
   their support for assistance.
 * You may add a custom function that hooks into ‘pmpro_has_membership_access_filter’
   and if the user is an admin return true to bypass all the membership restrictions–
   [https://www.paidmembershipspro.com/hook/pmpro_has_membership_access_filter/](https://www.paidmembershipspro.com/hook/pmpro_has_membership_access_filter/)
 * Here is a link to the guide – [https://www.paidmembershipspro.com/always-allow-admin-access-member-restricted-posts/](https://www.paidmembershipspro.com/always-allow-admin-access-member-restricted-posts/)
 * We don’t have any plans to implement this into core as of yet, but we will consider
   it.
 *  Thread Starter [davidblood](https://wordpress.org/support/users/davidblood/)
 * (@davidblood)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/#post-15503287)
 * Hi [@andrewza](https://wordpress.org/support/users/andrewza/),
 * Yeah, I’ve reached out to them multiple times via email and WordPress plugin 
   [4 months ago](https://wordpress.org/support/topic/error-logs-23/) but it seems
   it’s another abandoned plugin 2 years ago unfortunately!
 * Unfortunately I can’t afford premium to see that content, my website is small
   and $247 fee would take me about 3 years to pay for it for one hook, LOL.
 * I will try and be smart and play around with the custom function hook and see
   what I can _break_. 🙂
 * Thanks.
 *  [David Wang](https://wordpress.org/support/users/blogjunkie/)
 * (@blogjunkie)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/#post-15738668)
 * Hi [@davidblood](https://wordpress.org/support/users/davidblood/) hope this saves
   you some money.
 *     ```
       add_filter( 'pmpro_has_membership_access_filter', 'my_admins_bypass_pmpro_restrictions' );
   
       function my_admins_bypass_pmpro_restrictions( $hasaccess ) {
         if ( current_user_can( 'edit_posts' ) ) {
       	$hasaccess = true;
         }
         return $hasaccess;
       }
       ```
   
 * See: [https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/](https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/)
 *  Thread Starter [davidblood](https://wordpress.org/support/users/davidblood/)
 * (@davidblood)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/#post-15914724)
 * Hey [@blogjunkie](https://wordpress.org/support/users/blogjunkie/),
 * Firstly, apologies for no response! Totally forgot about this thread and had 
   no email of your reply.
 * Works perfectly, thanks for sharing!
 * Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Allow Admin Bypass Access?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [admin](https://wordpress.org/support/topic-tag/admin/)
 * [administrator](https://wordpress.org/support/topic-tag/administrator/)
 * [bypass](https://wordpress.org/support/topic-tag/bypass/)
 * [skip](https://wordpress.org/support/topic-tag/skip/)

 * 4 replies
 * 3 participants
 * Last reply from: [davidblood](https://wordpress.org/support/users/davidblood/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/allow-admin-bypass-access/#post-15914724)
 * Status: resolved