Skip to content

Kirby 5.0.4

$page->delete()

Deletes the page

$page->delete(bool $force = false): bool

Parameters

Name Type Default
$force bool false

Return type

bool

This method modifies the existing $page object it is applied to and returns it again.

Parent class

Kirby\Cms\Page

Examples

try {
  page('blog/old-article')->delete();
  echo 'The page has been deleted';

} catch(Exception $e) {
  echo $e->getMessage();

}