WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a save_post hook for custom post types?

example: save_my_post_type

I know there is publish_my_post_type but I'm looking for a save hook.

share|improve this question
up vote 8 down vote accepted

the hook is the same save_post just make sure its your post type ex:

function save_post_callback($post_id){
    global $post; 
    if ($post->post_type != 'MY_CUSTOM_POST_TYPE_NAME'){
    //if you get here then it's your post type so do your thing....
share|improve this answer

New solution, as of WP 3.7: save_post_{$post_type}

add_action( 'save_post_my_post_type', 'wpse63478_save' );
function wpse63478_save() {
    //save stuff

See the note on the codex page

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.