7

Anyone know a way round this?

http://wordpress.org/support/topic/set-draft-page-as-parent

I can't risk publishing as a public-facing system updates periodically from the same install.

3
  • I don't see why you'd want to have a non-public parent page The only way in which page hierarchy has any unique meaning is in cases that it's public. If you want this for associative purposes, I'd create a custom hierarchical taxonomy and use that to associate your non-public data (you could even mark it as 'private' instead of 'draft'). Oct 27 '10 at 13:49
  • 2
    @John: I found this a problem when I wanted to draft both a parent page and children at the same time.
    – e100
    Nov 12 '10 at 17:22
  • 1
    @John Exactly what e100 said - when trying to build out a hierarchy of pages in draft form before publishing. May not impact a smaller WP site but definitely an issue with larger sites that have many content changes at once.
    – nickb
    Aug 4 '13 at 19:05
17

This works for me:

add_filter('page_attributes_dropdown_pages_args', 'my_attributes_dropdown_pages_args', 1, 1);

function my_attributes_dropdown_pages_args($dropdown_args) {

    $dropdown_args['post_status'] = array('publish','draft');

    return $dropdown_args;
}
6
3

There is one way to do this, but it's kind of wonky. Instead of not publishing the page, you can hide the content.

Make a theme template named HidePageTemplate.php. On the page you want hidden change your template file to whatever you named your template In the template copy the structure of the 404 page. This way the page is published, so the child pages are published, but the content isn't visible.

/* Template Name: Hide Page Template */ get header 404-Not Found get sidebar get footer

4
  • Thanks Eileen. Unfortunately we need to set the templates to load in the correct custom fields for authoring the content (The site uses Custom Field Templates). If I had my way, we would get rid of Custom Field Templates but thats not an option at the moment.
    – codecowboy
    Oct 29 '10 at 8:03
  • I think I'm not entirely understanding what you need to do. I've never used that plugin. Maybe if you could better explain what the "hidden" parent page is supposed to do. WOuld the content from /about appear not on /about but rather on /about/our-team? You can still query all the content from the /about page onto any page you want. Also perhaps this might help, try building your own custom fields, maybe that will solve the problem. The link I used to do this is here sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields Oct 29 '10 at 14:00
  • Did that help at all? Nov 1 '10 at 21:45
  • This isn't a great solution if you want to keep the post entirely secret. If your post were to get pulled in a search, it would print out at least the excerpt. Nov 15 '10 at 14:04
0

I am facing the same problem, and the only solution I can think of without having to hide to content or edit the php (as previously suggested) is this:

Create all of the pages as drafts and once they are ready to be published, publish them and immediately go back in and change the child pages to the correct parent page.

0

There is the Inclusive Parents plugin - but it hadn't been updated for 5 years now - so it won't support Gutenberg either (see this comment).

It would be nice if someone could make a new WordPress plugin that is maintained and has Gutenberg support.

-1

You can't use unpublished pages as parents (or as a static front page, for that matter).

Eileen has, I think, a very elegant workaround.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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