Title: Exclude protected posts from WP query
Last modified: May 11, 2022

---

# Exclude protected posts from WP query

 *  Resolved [cbunce](https://wordpress.org/support/users/cbunce/)
 * (@cbunce)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/exclude-protected-posts-from-wp-query/)
 * Hello,
 * In my WordPress queries I have previously used ‘has_password’ to exclude those
   that are password protected. Please can you advise how/if this can be done using
   this plugin so I can specifically exclude the posts and pages from queries.
 * Thanks

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

 *  Plugin Author [Password Protect WordPress Page Support](https://wordpress.org/support/users/ppwp/)
 * (@ppwp)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/exclude-protected-posts-from-wp-query/#post-15634677)
 * Hi [@cbunce](https://wordpress.org/support/users/cbunce/),
 * Thanks for reaching out to us.
 * Yes, we do have a solution for you to achieve that.
 * For faster assistance from our team, could you send over specific codes you’re
   using to collect posts to our support email – hello(at)preventdirectaccess.com?
 * Which PPWP version are you using, by the way?
 *  Plugin Author [Password Protect WordPress Page Support](https://wordpress.org/support/users/ppwp/)
 * (@ppwp)
 * [4 years ago](https://wordpress.org/support/topic/exclude-protected-posts-from-wp-query/#post-15662869)
 * Hi [@cbunce](https://wordpress.org/support/users/cbunce/),
 * Hope you’re doing well as usual.
 * We haven’t heard back from you for a while now. So we’d like to follow up wondering
   if we can be of any further assistance.
 * Have you managed to get the issue resolved yet, [@cbunce](https://wordpress.org/support/users/cbunce/)?
 * Please reply to this support thread or drop us an email at hello(at)preventdirectaccess.
   com so that we can assist you further.
 * Awaiting your reply.
 *  Plugin Author [Password Protect WordPress Page Support](https://wordpress.org/support/users/ppwp/)
 * (@ppwp)
 * [4 years ago](https://wordpress.org/support/topic/exclude-protected-posts-from-wp-query/#post-15706647)
 * Just an update, the issue was resolved with the user via email.
 * As a reference for other users, in our [PPWP Lite](https://passwordprotectwp.com/docs/password-protect-wordpress-lite/)
   version, all passwords are stored under wp_postmeta table.
 * The content protection status is defined via wp_postmeta using the “wp_protect_password_multiple_passwords”
   meta_key.
 * Adding the following codes to his query worked.
 *     ```
       'meta_query' 
           array(
             'relation' => 'OR',
             array(
               'key' => 'wp_protect_password_multiple_passwords',
               'compare' => 'NOT EXISTS',
             ),
             array(
               'key' => 'wp_protect_password_multiple_passwords',
               'value' => 'false',
             )
           ),
       ```
   
 * Hope it helps.

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

The topic ‘Exclude protected posts from WP query’ is closed to new replies.

 * ![](https://ps.w.org/password-protect-page/assets/icon-256x256.jpg?rev=3263311)
 * [PPWP - Password Protect Pages](https://wordpress.org/plugins/password-protect-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/password-protect-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/password-protect-page/)
 * [Active Topics](https://wordpress.org/support/plugin/password-protect-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/password-protect-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/password-protect-page/reviews/)

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)

 * 3 replies
 * 2 participants
 * Last reply from: [Password Protect WordPress Page Support](https://wordpress.org/support/users/ppwp/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/exclude-protected-posts-from-wp-query/#post-15706647)
 * Status: resolved