WordPress Email Registration Blacklist (CMRB) - Use Case - How to Restrict Posting Comments for Non Registered Users Based on Email or Domain


Use Case - How to Restrict Posting Comments for Non Registered Users Based on Email or Domain

Note: This guide requires:


Introduction

The WordPress Email Registration Blacklist plugin allows you to block users who try to register on your WordPress site using an email from a domain/email/IP defined in your blacklists/online lists. It also allows you to approve only users from a whitelist.

The plugin also allows to restrict posting comments by non registered users on your site.

Use Case Front-End

Front-end example - WordPress Blacklist Plugin
Front-end example

Use Case Assumptions

In this use case example we will consider how to restrict posting comments by non registered users on your site based on either the global white and blacklists of emails and domains, or based on the allowed list of domains.

It follows:

Installing the Plugin

The process is the same for all CM plugins and add-ons.

CreativeMinds Customer Account Dashboard - Downloads tab
CreativeMinds Customer Account Dashboard
  • Download the plugin from your customer dashboard.
  • Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
  • Click on Add New.
  • Activate it and add the license.

Learn more: Getting Started - Plugin Overview


Quick Recap

We recommend you first to get to know how white and blacklists work in the plugin. To do this, please, check the following use case guide:

Comments Allowed Domains Settings

To configure the feature for restricting comments, navigate to Admin Dashboard → CM E-Mail Registration Blacklist → Comments Allowed Domains tab.

Navigation to the settings for restricting comments - IP Blacklist WordPress Plugin
Navigation to the settings for restricting comments

There you will find the following settings:

Comments allowed domains settings - WordPress Email Blacklist Plugin
Comments allowed domains settings

Comments allowed domains control

  • Use allowed domains for comments filtration - Enable this option to filter who is allowed to leave comments on your site.
  • Use below whitelist domains for comments filtration - If enabled, only domains which are added in the Domains that are allowed to leave comments area will be allowed to leave comments.
  • Domain is not allowed to left a comment - You can change the message that the guest will see, if he is not allowed to leave a comment.

Domains that are allowed to leave comments

  • Add new domain or domain extension - Enter here domains that you want to be allowed to leave comments.

You can use full domain names  (e.g. gmail.com) or wildcards (e.g. *mail.com). You can also use domain extension names with wildcards (e.g. *.com).

Who Is Allowed to Leave Comments?

First of all, this feature does not affect posting comments for registered users. If the user is registered on the site, it doesn't matter if he is logged-in or not. If he is logged-in, his comments will be published, and if he is not logged-in and tries to leave a comment using his email (that was used for registration on the site) - the comment will be published.

As for non registered users, there are two ways how you can filter who is allowed to leave comments.

Case #1 - Restriction Based On Global White and Blacklists

  • The option Use allowed domains for comments filtration is enabled 
  • The option Use below whitelist domains for comments filtration is disabled.

    Filtering comments based on email/domain white and blacklists - Domain Blacklist Plugin
    Filtering comments based on email/domain white and blacklists

In this case, filtering will work based on general settings of which lists are activate - domain and email white/black lists, DNSBL and Free Domain lists:

Plugin sections for setting up white and blacklists - WordPress Restrict Email Domains
Plugin sections for setting up white and blacklists

Let's check it all in action.

Here's an example of our Domain Blacklist:

Domain blacklist - WordPress Block Domain Registration
Domain blacklist

Now let's try to leave a comment using one of the blacklisted domains - the user will just see a message that he's not allowed to leave comments.

Front-end example - WordPress Blacklist Plugin
Front-end example

And now let's try to leave a comment our blacklisted email:

Front-end example - IP Blacklist WordPress Plugin
Front-end example

The result will be the same - the user will see the same message as in the previous case with blacklisted domain:

Front-end example - WordPress Email Blacklist Plugin
Front-end example

Another case - in our domain blacklist we have a "gmail.com" domain, but one of the users that is registered on our site uses this domain - he was registered manually by the admin. The comment will be successfully published, because the user with this email is registered on the site.

Front-end example - Domain Blacklist Plugin
Front-end example

The same will happen if the used email is either whitelisted or its domain belongs to one of the whitelisted domains - the comments will be published.

Case #2 - Restriction Based On the List of Allowed Domains

  • The option Use allowed domains for comments filtration is enabled.
  • The option Use below whitelist domains for comments filtration is enabled.

    Allowing leaving comments only to certain domains - WordPress Restrict Email Domains
    Allowing leaving comments only to certain domains

In this case, only the users with email domains which are added to the Domains that are allowed to leave comments area will be allowed to leave comments. So let's add a few domains and one domain wildcard:

List of allowed domains - WordPress Block Domain Registration
List of allowed domains

Before trying to use some domain from the list of allowed domains, let's first try to publish some comment using a whitelisted email, or using an email that belongs to the whitelisted domain.

Here's our whitelisted domain:

Domain whitelist - WordPress Blacklist Plugin
Domain whitelist

The comment will not be published in this case:

Front-end example - IP Blacklist WordPress Plugin
Front-end example

And here's our whitelisted email:

Email whitelist - WordPress Email Blacklist Plugin
Email whitelist

The comment will not be published in this case also:

Front-end example - Domain Blacklist Plugin
Front-end example

And now let's try to leave a comment using any email with one of the domains that we've added to the list of allowed domains - the comment will be successfully published:

Front-end example - WordPress Restrict Email Domains
Front-end example

End Result

Following instructions found in the plugin and guides, you should be able to restrict posting comments by non registered users on your site.

Use Case Front-End

Front-end example - WordPress Block Domain Registration
Front-end example

More information about the WordPress Email Registration Blacklist plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.