Restrict publish environment (preview or live) by user role

As a standard feature, Strattic allows you to control which WordPress user roles have the ability to publish to your static preview and live environments by going to Strattic > Settings > General (learn more about general settings)

Restrict publishes by publish type (full, quick or selective) and environment (preview or live) by user role

If you wish to take that a step further, it is possible to also limit publishing types (full publish, quick publish and selective publish) for user groups as well.

As an example;

You may want your authors to only have the ability to publish to your preview environment and not to your live environment.


Step 1.

Install and activate the free User Role Editor plugin

Step 2.

Now, in the WordPress Admin menu, go to Users > User Role Editor

Select a role that you've created a user for (e.g. Author)

Step 3.

Select a role that you've created a user for (e.g. Author)

Step 4.

Use the Quick filter search box to type "strattic".

Step 5.

You should see the following capabilities:

  • strattic_can_publish_to_live_full

    User role can initiate a full publish to the live environment

  • strattic_can_publish_to_live_quick

    User role can initiate a quick publish to the live environment

  • strattic_can_publish_to_live_selective

    User role can initiate a selective publish to the live environment

  • strattic_can_publish_to_preview_full

    User role can initiate a full publish to the preview environment

  • strattic_can_publish_to_preview_quick

    User role can initiate a quick publish to the preview environment

  • strattic_can_publish_to_preview_selective

    User role can initiate a selective publish to the preview environment

Check the box next to the ability you wish to enable for that user role.

Step 6.

Once you have made all your changes, press the blue update button to save.

Restrict publishing to individual users

You may want to go a step even further and only allow certain users on your site to be able to publish.

  1. Install and active the Members plugin.

  2. In your WordPress admin, go to Members > Roles

  3. Clone an existing role, typically "Administrator" and name it “Admin with Strattic Publish” (or similar)

  4. Confirm that the new role all the Strattic publish options:

  5. Edit the default "Admin" role and remove all the Strattic publish options by unchecking the checkmarks in the "Grant" column:

  6. Assign the relevant users to the new “Admin with Strattic Publish” role.

Did this answer your question?