Title: Interrupting &#039;save_post&#039;
Last modified: August 19, 2016

---

# Interrupting 'save_post'

 *  [caddoo](https://wordpress.org/support/users/caddoo/)
 * (@caddoo)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/interrupting-save_post/)
 * I have created a custom post type in wordpress with custom meta fields.
 * These have all be done with the wordpress php functions.
 * I need validation on these custom meta fields and I am currently using this messy
   method:
 * [http://bit.ly/gTwTyf](http://bit.ly/gTwTyf)
 * I understand I might have to stick with this method.
 * But what I need to know is how could I prevent the post from saving if the meta
   fields dont meet requirements.

Viewing 1 replies (of 1 total)

 *  [molnarm](https://wordpress.org/support/users/molnarm/)
 * (@molnarm)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/interrupting-save_post/#post-1880743)
 * Interrupting post saving might not be a good way because all content would be
   lost. (Imagine typing a long post then losing it all because of a little error
   in a meta field…). If the meta value is wrong, don’t save it or even better, 
   use a default value.

Viewing 1 replies (of 1 total)

The topic ‘Interrupting 'save_post'’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [molnarm](https://wordpress.org/support/users/molnarm/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/interrupting-save_post/#post-1880743)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
