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 have a site I'm putting together for a friend and I would like all new pages that are created to be the children of a set page (page id 495). I assume that I need to edit the meta-boxes.php file but not sure other than that.

Can anyone help me with this? I'd appreciate any comments.


share|improve this question

This hooks onto the wp_insert_post_data filter, and checks if the post to be inserted is both a page and an auto-draft (which happens when you first create a new post/page).

add_filter( 'wp_insert_post_data', 'wpse_59007_set_default_page_parent' );
function wpse_59007_set_default_page_parent( $data )
    if ( $data['post_status'] == 'auto-draft' && $data['post_type'] == 'page' )
        $data['post_parent'] = 495;
    return $data;
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.