Title: How to exclude empty fields
Last modified: August 31, 2016

---

# How to exclude empty fields

 *  [phogulum](https://wordpress.org/support/users/phogulum/)
 * (@phogulum)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/how-to-exclude-empty-fields/)
 * When showing single participant I want to exclude empty fields so that the field
   title also doesn’t appear but I couldn’t figure out what syntax I should use.
   In pdb-single-default.php I’ve tried something like
    `if (in_array( $this->field-
   >name.value, "") ) continue;` but that’s not correct of course.
 * [https://wordpress.org/plugins/participants-database/](https://wordpress.org/plugins/participants-database/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/how-to-exclude-empty-fields/#post-6956237)
 * Well there are several ways to do this, of course, but a simple check for an 
   empty value would be:
 *     ```
       if ( $this->field->value === '' ) {
         continue;
       }
       ```
   
 * It’s also possible to use CSS to hide empty fields. If you look at the HTML of
   the default template, you’ll see that empty fields have a special classname so
   you can hide them if you want:
 *     ```
       .blank-field {
         display:none;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘How to exclude empty fields’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/how-to-exclude-empty-fields/#post-6956237)
 * Status: not resolved