For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
      • Page information
      • Page settings
        • Check if page is draft
        • Set draft status
        • Check if page is homepage
        • Check if page is password protected
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • page.setDraft()
Pages & FoldersManaging PagesPage settings

Set draft status

Was this page helpful?
Previous

Check if page is homepage

Next
Built with

page.setDraft()

Set the draft status of the page.

Syntax

1page.setDraft(isDraft: boolean): Promise<null>

Parameters

  • isDraft: boolean - Whether the page should be set to draft mode.

Returns

Promise<null>

A promise that resolves to null.

Example

1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set page as draft
5await currentPage.setDraft(true)
6const isDraft = await currentPage.isDraft()
7
8// Print status
9console.log(isDraft)

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny