Title: Make custom post field mandatory
Last modified: August 20, 2016

---

# Make custom post field mandatory

 *  [IoanPokorny](https://wordpress.org/support/users/ioanpokorny/)
 * (@ioanpokorny)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/make-custom-post-field-mandatory/)
 * I would like to make a custom field mandatory.
 * How can I add a hook so that a field is checked when I want to publish the post
   and prevent that from happening ‘if ( isset( $_POST[‘p2p_connections’] ) )’ (
   if that field has not been selected).
 * Thanks in advance

The topic ‘Make custom post field mandatory’ is closed to new replies.

## Tags

 * [check](https://wordpress.org/support/topic-tag/check/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [mandatory](https://wordpress.org/support/topic-tag/mandatory/)
 * [posts2posts](https://wordpress.org/support/topic-tag/posts2posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [IoanPokorny](https://wordpress.org/support/users/ioanpokorny/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/make-custom-post-field-mandatory/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
