Add a Publish Rule
Adding a publish rule allows you to control the publishing and unpublishing of entries by defining approval or workflow stage requirements for specific content types and environments. This ensures quality and compliance by requiring each entry to meet organizational standards or reach the designated workflow stage before it can be published or unpublished.
Note: Only the stack owner, admin, or developer can add a publish rule.
Setting up publish rules within a workflow is optional. However, because publishing and unpublishing are integral to content operations, publish rules are included in the Workflows feature.
To add a Publish Rule, log in to your Contentstack account and follow these steps:
- Navigate to your stack and click the “Settings” icon in the left navigation panel, or press the shortcut key “S” (on both Windows and macOS).
- In the left panel, select Workflows and go to the Publish Rules tab.
- Click + New Publish Rule.
- On the Rule Details page:
- Select a branch or branches to apply the rule.
Tip: Multiple branches can be selected.
- Select the content types:
- All Content types – Apply the rule globally.
- Specific Content Type(s) – Select desired types from the dropdown.
- Select a branch or branches to apply the rule.
Note: You cannot add more than one rule to a content type.
- Select the language(s):
- All Languages – Apply the rule to all languages.
- Specific Language(s) – Choose desired languages from the dropdown.
- Select the Environment for rule application.
- Choose the action(s) to which the rule applies. Select Publish, Unpublish, or All to apply to both.
Note: All parameters are required fields.
- Expand the Conditions section (if not expanded by default). Use at least one condition:
- Approver: Add users or roles who must approve before publishing or unpublishing.
- Workflow Stage: Specify the workflow stage required before an entry can be published or unpublished.
- After completing all required fields, click Save.
This results in the creation of a publish rule that governs publishing actions based on selected parameters and conditions within a defined workflow.
Note: Publish rules apply only to unpublished versions of an entry. Once a version passes through the conditions and is published, it can be republished without restriction—even if moved to a different stage. To re-trigger the rules, the entry must be modified to create a new version.
This approach streamlines publishing across locales and environments by eliminating redundant approvals, reducing delays, and ensuring timely content distribution.
Example Scenario
Your team creates a blog post titled “Holiday Sale Preview”. The publish rule requires legal approval and that the entry reaches the “Final Review” stage before it can be published.
- When the post is first published, the entry is routed for approval and checked against the required workflow stage.
- If a content manager later republishes the same version in a different environment, the rule is not triggered again, as it has already met the required conditions.
- However, if the post is edited—for example, by updating pricing or images—a new version is created. In that case, the rule is enforced again, requiring fresh approval and workflow validation.
API Reference
To add a Publish Rule via API, refer to the Create Publish Rules request.