Title: Protect custom posttype page
Last modified: August 30, 2016

---

# Protect custom posttype page

 *  Resolved [ctuxboy](https://wordpress.org/support/users/ctuxboy/)
 * (@ctuxboy)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/)
 * Hello,
 * I make a custom posttype ‘video’, and a template **archive-video.php**, that 
   list only this posttype.
    Is it possible protect this template?
 * Regards,
    Christophe
 * [https://wordpress.org/plugins/simple-membership/](https://wordpress.org/plugins/simple-membership/)

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

 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681082)
 * Hi if the template follows WordPress code rules then yes it should protect your
   template.
 *  Thread Starter [ctuxboy](https://wordpress.org/support/users/ctuxboy/)
 * (@ctuxboy)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681131)
 * Hi,
 * Thanks for you’re reply.
 * I found another solution.
 * In the **archive-video.php** file, adding this code:
 *     ```
       global $post;
       $post_id = $post->ID;
       $access_ctrl = SwpmAccessControl::get_instance();
       if ($access_ctrl->can_i_read_post($post_id)){
       // THE LOOP
       }
       ```
   
 * I find this snippet on the support page:
    [https://simple-membership-plugin.com/simple-membership-miscellaneous-php-tweaks/](https://simple-membership-plugin.com/simple-membership-miscellaneous-php-tweaks/)
 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681173)
 * I am happy to hear you found a solution.
 *  [reclifford](https://wordpress.org/support/users/reclifford/)
 * (@reclifford)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681383)
 * Were you able to protect this so any member could access that page?
 *  Plugin Author [wp.insider](https://wordpress.org/support/users/wpinsider-1/)
 * (@wpinsider-1)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681384)
 * FYI – we are currently investigating an option to see if we can introduce a custom
   post type protection capability in this plugin.

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

The topic ‘Protect custom posttype page’ is closed to new replies.

 * ![](https://ps.w.org/simple-membership/assets/icon-128x128.png?rev=974529)
 * [Simple Membership](https://wordpress.org/plugins/simple-membership/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-membership/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-membership/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-membership/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-membership/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-membership/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [wp.insider](https://wordpress.org/support/users/wpinsider-1/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/protect-custom-posttype-page/#post-6681384)
 * Status: resolved