草稿与发布
🌐 Draft & Publish
Page summary:草稿与发布将草稿与已发布条目分开,让编辑可以在发布前进行内容准备。本文档展示了如何按内容类型启用该功能,以及如何管理发布或取消发布操作。
“草稿与发布”功能让你可以管理内容的草稿。
🌐 The Draft & Publish feature allows you to manage drafts for your content.
配置
🌐 Configuration
配置此功能的路径: 内容类型构建器
要在内容管理器中使用草稿与发布管理你的内容类型,必须通过内容类型构建器启用该功能。草稿与发布可以为每个内容类型进行配置。
🌐 For your content types to be managed with Draft & Publish in the Content Manager, the feature must be enabled through the Content-type Builder. Draft & Publish can be configured for each content type.
- 编辑已创建的任意内容类型,或创建新的内容类型(更多信息请参见 Content Type Builder 文档)。
- 转到高级设置选项卡。
- 勾选草稿和发布选项。
- 点击 完成 按钮。

当在内容类型上启用草稿和发布时,属性名称 status 被 Strapi 保留,不能用于用户定义的属性。内容类型构建器将阻止:
🌐 When Draft & Publish is enabled on a content type, the attribute name status is reserved by Strapi and cannot be used for a user-defined attribute. The Content-type Builder will block:
- 向启用草稿和发布的内容类型添加名为
status的属性。 - 在已经具有
status属性的内容类型上启用草稿与发布。
如果内容类型从 Strapi v4 项目继承了 status 属性,Strapi 5 会在启动时记录警告。在重新启用草稿和发布功能之前重命名该属性,以避免 API 冲突。完整操作请参阅 迁移指南。
🌐 If a content type inherited a status attribute from a Strapi v4 project, Strapi 5 logs a warning at bootstrap. Rename the attribute before re-enabling Draft & Publish to avoid API conflicts. See the migration guide for the full procedure.
记录首次发布日期 experimental_firstPublishedAtThis feature requires the experimental_firstPublishedAt feature flag to be enabled.
🌐 Recording the first publication date experimental_firstPublishedAtThis feature requires the experimental_firstPublishedAt feature flag to be enabled.
当启用此未来功能标志时(参见 功能配置),Strapi 会自动向所有使用草稿与发布的内容类型添加一个 firstPublishedAt 属性。该属性会保存条目首次发布的日期和时间,即使条目被取消发布然后再次发布,该属性也不会更改。
🌐 When this future flag is enabled (see features configuration), Strapi automatically adds a firstPublishedAt attribute to all content-types that use Draft & Publish. The attribute saves the date and time when an entry is first published and never changes even if the entry is unpublished and published again.
如果功能标志随后被禁用,firstPublishedAt 属性及其存储的值将被移除。
🌐 If the feature flag is disabled later, the firstPublishedAt attribute and its stored values are removed.
使用
🌐 Usage
启用草稿与发布后,内容管理员的编辑视图 会在界面顶部显示你的内容类型条目的当前状态。你的内容可以有三种状态:
🌐 With Draft & Publish enabled, the Content Manager's edit view indicates the current status of your content type's entry at the top of the interface. Your content can have 3 statuses:
- 已发布:内容已先前发布。没有保存的未完成草稿更改。
- 已修改:内容之前已经发布。你对草稿版本进行了一些修改并保存了这些更改,但这些更改尚未发布。
- 草稿:内容尚未发布。
当启用“草稿 & 发布”时,在 内容管理器 列表视图中,你可以使用 筛选器 按状态过滤条目。你还可以通过点击列表视图中的 状态 列标题按发布状态对条目进行排序。
🌐 When Draft & Publish is eanbled, in the Content Manager list view, you can filter entries by status using the Filters button. You can also sort entries by publication status by clicking the Status column header in the list view.
处理草稿
🌐 Working with drafts
路径: 内容管理员,编辑你的内容类型视图
在编辑文档时,你可以看到 2 个选项卡:
🌐 While editing a document, you can see 2 tabs:
- 草稿 标签是你可以编辑内容的地方。
- 已发布 选项卡是只读选项卡,所有字段的编辑都被禁用。已发布 选项卡存在的唯一目的是显示已发布版本中字段的内容。

默认情况下,每个新创建的内容都是草稿。草稿可以随意修改和保存,使用界面右侧的 Entry 框中的 保存 按钮,直到它们准备好发布为止。
🌐 By default, each newly created content is a draft. Drafts can be modified and saved at will, using the Save button in the Entry box on the right side of the interface, until they are ready to be published.
一旦你对草稿进行了修改,你有3个可能的选项,所有这些选项都可以在界面右侧的 Entry 框中找到:
🌐 Once you made changes to a draft, you have 3 possible options, all available in the Entry box on the right side of the interface:
- 发布你的文档(请参阅 发布草稿),
- 保存你的草稿以便以后检索,
- 或者通过点击 并选择 放弃更改来放弃更改。
发布草稿
🌐 Publishing a draft
路径: 内容管理员,编辑你的内容类型视图
要发布草稿,请点击界面右侧 Entry 框中的 发布 按钮。
🌐 To publish a draft, click on the Publish button in the Entry box on the right side of the interface.
草稿发布后:
🌐 After a draft is published:
- 草稿 和 已发布 标签的内容应完全相同(但 已发布 标签仍然是只读的)。
- 位于文档标题下方的状态将切换为“已发布”.
在发布草稿之前,请确保它与其他未发布的内容没有关系,否则某些内容可能无法通过 API 访问。
🌐 Before publishing a draft, make sure it doesn't have relations with other non-published content, otherwise some of the content may not be available through the API.
当一个文档既有草稿版本又有已发布版本时,已发布版本可以在_已发布_标签中找到。如果文档只有草稿版本,则无法点击_已发布_标签。
🌐 When a document has both a draft and a published version available, the published version can be found in the Published tab. If the document has only a draft version, you can not click on the Published tab.

要安排发布(即在指定的日期和时间将草稿转换为已发布条目),你可以将其包含在一个 发布中,并安排该发布的发布时间。有关更多信息,请参阅 发布功能 文档。
🌐 To schedule publication (i.e. convert a draft to a published entry at a given date and time) you can include it in a release and schedule the publication of that release. Please refer to the Releases feature documentation for more information.
取消发布内容
🌐 Unpublishing content
路径: 内容管理员,编辑你的内容类型视图
要取消发布已发布的内容:在“草稿”标签中,点击界面右侧“条目”框中的 ,然后选择取消发布按钮。
如果文档的草稿版本包含与已发布版本不同的内容,你可以决定在取消发布时如何处理这两种内容:
🌐 If the draft version of the document contains content different from the published version, you can decide what to do with both content when unpublishing:
- 在“草稿”标签中,点击界面右侧“条目”框中的 ,然后选择取消发布按钮。
- 在打开的确认对话框中,你可以选择:
- 取消发布并保留最后的草稿,这样你当前在 草稿 标签中的所有内容都会被保留,但 已发布 标签中的所有内容肯定会被删除
- 取消发布并替换最后的草稿,以丢弃 草稿 选项卡中的所有现有内容,并用