Allow or Restrict Anonymous Posting to Specific Categories

:notebook_with_decorative_cover: This is a how-to topic that will guide site admins through the process of creating a group for anonymous users to be automatically added to, and then allowing or restricting anonymous posting on a per category basis.

:warning: Before continuing here, you will need to make sure you’ve enabled anonymous mode on your site.

Create a Group for Anonymous Users

When anonymous posting mode is enabled, a new anonymous user is created when a user enters anonymous mode.

This user automatically gets an account with a fake email address where the email address domain has anon prepended along with the domain of the site.

For example, if you had a Discourse site with the domain community.example.com, all anonymous users on your site would have an email with the domain anon.community.example.com.

:person_tipping_hand: To see what this looks like on your site, view the admin page for any anonymous user, and then click the “Primary Email” button - this will show you what format anonymous user email domains will be for your site.

You can then use this domain to automatically assign anonymous users to a specific group by doing of the following:

  • Create a new group for anonymous users, and then add the anonymous user email domain to the list of “Automatic” domains.

  • Modify the settings of an existing group under the group’s Manage → Membership page by adding your site’s anonymous user email domain to the “Automatic” domains.

Once this has been done all anonymous users on your site will be automatically added to that group!

Anonymous Posting on a per Category Basis

Now that all of your anonymous users are associated with a group, you can use that group to allow or restrict anonymous users to reply to or create topics in specific categories on a category’s Security page.

Let’s take a look at a couple example of this:

Ex: Allow Anonymous Posting

The following settings would allow only anonymous users to see, reply, and create topics in this category:

Ex: Restrict Anonymous Posting

If you wanted to allow trust_level_3 and trust_level_4 users on your site to be able to post in a category, but not anonymous users, you could use these settings:

:person_tipping_hand: For more examples of how to use the Security tab on the category edit page to control both the visibility of categories and what users can do in a category, see Understanding groups and category permissions (security settings).

Additional Notes

:person_tipping_hand: By default, anonymous posting is allowed in all categories.

Depending on how you want to structure anonymous posting on your site your site, you may need to go through all categories on your site and adjust the Security settings to explicitly allow or restrict your anonymous group from accessing those categories.

5 Likes

Does this work for truly anonymous users? i.e. users who just landed in the website but don’t log in, they don’t have an account setup.

No, I’m afraid this is for the anonymous users created as part of the allow anonymous posting feature. You still need an account to be able to post.

2 Likes