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

I created a custom post type and for debugging reasons i display the Post ID on the Add New ... page. If i refresh the page without saving or even creating a new post,(so i just press f5 on the post-new.php) the post ID is growing one by one.

Why is this happening and is this the normal behaviour?

share|improve this question
up vote 2 down vote accepted

This is normal behaviour, as I understand it.

When you load the page post-new.php, you run this function:

$post = get_default_post_to_edit( $post_type, true );

where the second argument stands for $create_in_db. If true then this part is executed:

if ( $create_in_db ) {
            $post_id = wp_insert_post(...);

inside get_default_post_to_edit().

share|improve this answer
Thanks, i don't worry about this then, but its still a little strange i think...:) – passatgt Apr 1 '13 at 11:49

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.