# $productPage->changeStatus()

> Change the status of the current page to either draft, listed or unlisted. If changing to `listed`, you can pass a position for the page in the siblings collection. Siblings will be resorted.

- Source: `src/Cms/PageActions.php#L232` <https://github.com/getkirby/kirby/blob/6.0.0-beta.1/src/Cms/PageActions.php#L232>
- Inherited from Kirby, not part of the Merx API. See <https://getkirby.com/docs/reference>.

```php
$productPage->changeStatus(string $status, int|null $position = null): Kirby\Cms\Page
```

## Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `$status` | `string` | `–` | "draft", "listed" or "unlisted" |
| `$position` | `int\|null` | `null` | Optional sorting number |

## Return type

`Kirby\Cms\Page`

## Exceptions

| Type | Description |
| --- | --- |
| `InvalidArgumentException` | If an invalid status is being passed |

## Parent class

`Wagnerwagner\Merx\ProductPage` inherited from `Kirby\Cms\Page`
