Title: Password Protect Custom Fields
Last modified: November 5, 2023

---

# Password Protect Custom Fields

 *  Resolved [ali.dolphin](https://wordpress.org/support/users/alidolphin/)
 * (@alidolphin)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/password-protect-custom-fields-2/)
 * Hi
 * I am trying to password protect custom fields using the default WordPress Password
   Protect feature.
 * Can you confirm if the following code will work with hiding a location custom
   fields. I will need to expand this to multiple fields.
 *     ```
       if ( post_password_required() ) {
           $value = get_field( "Location" );
   
           if( $value ) {
               echo $value;
           }
       } else {
           echo 'You need to enter a password to see this information';
       }
       ```
   
    -  This topic was modified 2 years, 6 months ago by [ali.dolphin](https://wordpress.org/support/users/alidolphin/).
    -  This topic was modified 2 years, 6 months ago by [ali.dolphin](https://wordpress.org/support/users/alidolphin/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/password-protect-custom-fields-2/#post-17179021)
 * Hi [@alidolphin](https://wordpress.org/support/users/alidolphin/)
 * Based on the documentation this would indeed not display the value if no password
   is provided.
   However, keep in mind that there are more methods of retrieving 
   metadata like the REST API so if there is sensitive data there you’ll have to
   validate this in more areas.
 * Cheers, Jory

Viewing 1 replies (of 1 total)

The topic ‘Password Protect Custom Fields’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/password-protect-custom-fields-2/#post-17179021)
 * Status: resolved