# Disable Draft Status

**URL:** <https://forum.getkirby.com/t/disable-draft-status/12212>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 17, 2019, 4:13pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212 "2019-01-17T16:13:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 17, 2019, 4:13pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/1 "2019-01-17T16:13:41Z")

</div>

Lets see if I stumbled on a bug or if this is the intended behaviour.  
I’m setting up the blueprint for the homepage of a site and I’m trying to configure the `status`

If I use this

```auto
status:
    draft : Draft
    unlisted : Unlisted
    listed : Published

```

Everything works as expected

 ![59](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/4/457f8cc0afb00fb40d1943a7096cd9970da64c2e.png)

But if I try to disable the draft and only allow for listed/unlisted like this

```auto
status:
    unlisted : Unlisted
    listed : Published

```

Then the draft is back with also the extra help text

 ![34](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/c4bba35a2ee8638dce1a7079b8a038593bb19248.png)

So the question is: Is there a way to allow users to switch status between listed unlisted without allowing a page to be set as draft?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 17, 2019, 4:39pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/2 "2019-01-17T16:39:37Z")

</div>

You can’t disable the draft state. All pages are always created as drafts first. Are you using a hook to set a listed or unlisted state on page creation?

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 17, 2019, 4:40pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/3 "2019-01-17T16:40:46Z")

</div>

No I was trying to find a way to prevent users to set the homepage as draft

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 17, 2019, 4:41pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/4 "2019-01-17T16:41:19Z")

</div>

Why don’t you just set `changeStatus`to false? Doesn’t really make sense to switch between published and listed for the home page.

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 17, 2019, 4:42pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/5 "2019-01-17T16:42:25Z")

</div>

On my site visible pages are displayed in a list in the footer.  
So if you want a page to be displayed there you simply change the status to visible.

Worked flawlessly on K2.

Now in K3 i have this draft variable added to the mix.

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 17, 2019, 4:43pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/6 "2019-01-17T16:43:13Z")

</div>

Also, doesn’t make much sense to be able to set the homepage of the site as draft 😄

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 17, 2019, 4:47pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/7 "2019-01-17T16:47:33Z")

</div>

It doesn’t even work to set the home page as a draft. So yes, the option shouldn’t even be visible for the homepage. Could you file an issue, please?

For all other pages, you wouldn’t be able to create pages if there was no draft state.

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 17, 2019, 4:51pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/8 "2019-01-17T16:51:08Z")

</div>

> Could you file an issue, please?

Absolutely. Doing it now.

As for this:

> For all other pages, you wouldn’t be able to create pages if there was no draft state.

This is another issue and I think there could be a solution (for example allow the possibility of creating pages with the desired status as default) but it’s not that important right now 😉

---

<div class="post-metadata">

**Author:** ![luxlogica](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/luxlogica/32/437_2.png) [@luxlogica](https://forum.getkirby.com/u/luxlogica)\
**Post date:** [January 18, 2019, 8:27pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/9 "2019-01-18T20:27:24Z")

</div>

…or, if we had the [ability to programatically override blueprint options](https://github.com/getkirby/kirby/issues/1370), you could use a `page.create:after` hook to change the status of the page after creating it, even if in its blueprint you had set its `changeStatus: false`.

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [January 19, 2019, 9:19am UTC](https://forum.getkirby.com/t/disable-draft-status/12212/10 "2019-01-19T09:19:46Z")

</div>

Although useful this wouldn’t really solve my problem because my main issue is with pages that are already there such as the homepage.

---

<div class="post-metadata">

**Author:** ![moeli](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/moeli/32/8964_2.png) [@moeli](https://forum.getkirby.com/u/moeli)\
**Post date:** [January 19, 2019, 2:24pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/11 "2019-01-19T14:24:42Z")

</div>

You could just hide this option with css

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 19, 2019, 2:43pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/12 "2019-01-19T14:43:28Z")

</div>

Unless I’ve overlooked something, I don’t think you can do that just for that single page, you’d hide the draft option from every single page.

---

<div class="post-metadata">

**Author:** ![moeli](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/moeli/32/8964_2.png) [@moeli](https://forum.getkirby.com/u/moeli)\
**Post date:** [January 19, 2019, 6:09pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/13 "2019-01-19T18:09:04Z")

</div>

You are right. I keep forgetting that I am using this plugin: [Kirby 3: Panel View Extended](https://forum.getkirby.com/t/kirby-3-panel-view-extended/12270)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 19, 2019, 6:33pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/14 "2019-01-19T18:33:45Z")

</div>

Yep, that’s a different story. However, it would just be a workaround while the issue that the draft option exists when you can’t make the home page a draft page, persists.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 30, 2019, 12:09am UTC](https://forum.getkirby.com/t/disable-draft-status/12212/15 "2019-01-30T00:09:22Z")

</div>

This is fixed on RC 3.0.1 and will be in the next release.

---

<div class="post-metadata">

**Author:** ![MoritzLost](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/moritzlost/32/13227_2.png) [@MoritzLost](https://forum.getkirby.com/u/MoritzLost)\
**Post date:** [November 21, 2022, 4:23pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/16 "2022-11-21T16:23:42Z")

</div>

@texnixe Is there a way to set pages to prevent editors from turning published pages into drafts again?

We’re using the following hook to publish a page automatically as soon as it’s created:

```auto
'page.create:after' => function ($event, $page) {
    $pagesToUnlist = [
        'pages/news-category',
        'pages/news-category-index',
    ];
    if (in_array($page->blueprint()->name(), $pagesToUnlist)) {
        $page->changeStatus('unlisted');
    }
},

```

This works fine, any new page is set to unlisted as soon as it’s created. But editors still have the option to turn the page back into a draft, which we don’t want to allow in this case.

We tried to set `changeStatus: false` in the blueprint. But this disables not only the option in the panel, but also the API apparently, so with this we can’t create any new pages since the hook will cause an error.

Is there a simple way to set pages to be published automatically (skipping the draft stage) and not allow editors to change the status?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 21, 2022, 4:58pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/17 "2022-11-21T16:58:40Z")

</div>

> [@MoritzLost](#):
>
> `changeStatus: false` in the blueprint.

You can set this to false only for the editor rule, should still allow you to change the status as the impersonated kirby user or the admin.

```auto
changeStatus:
  editor: false
```

---

<div class="post-metadata">

**Author:** ![MoritzLost](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/moritzlost/32/13227_2.png) [@MoritzLost](https://forum.getkirby.com/u/MoritzLost)\
**Post date:** [November 22, 2022, 8:43am UTC](https://forum.getkirby.com/t/disable-draft-status/12212/18 "2022-11-22T08:43:01Z")

</div>

@texnixe Thanks for the suggestion! Using roles to limit access is a solid option. Though for small sites with only few editors, we won’t create any roles or permission checks, so it would still be nice if it was possible to achieve this behaviour for everyone.

---

<div class="post-metadata">

**Author:** ![adamkiss](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adamkiss/32/6058_2.png) [@adamkiss](https://forum.getkirby.com/u/adamkiss)\
**Post date:** [December 7, 2022, 11:06pm UTC](https://forum.getkirby.com/t/disable-draft-status/12212/19 "2022-12-07T23:06:16Z")

</div>

You should be able to programatically create a page in other status than draft with `Page::create`.

It takes a bit of work - you need (?) to add more stuff, but it works:

```php
$page = Page::create([
  'kirby' => kirby(),
  'site' => site(),
  'parent' => $parent,
  'isDraft' => false,
  'num' => null

  /* … and slug, template, model and content */
])->save();

```
