I started to develop IP Location Block as a security purpose plugin so as to protect the back-end of the site. And since version 3.0.0, it has been equipped with the functionality of front-end protection based on this suggestion at the support forum.
This helped to greatly improve the protection ability of this plugin against attacks via the front-end of the site.
Need for content filtering by country
Meanwhile, this also helped to make the purpose of this plugin ambiguous. Because the function of this plugin to specifying the validation target with the page, post type, category, and tab is not enough for a user who wants to manage contents by Geo-blocking.
For example, this discussion indicated that not only categories or tags but also custom taxonomies are needed to specify the targets.
But I don’t like to extend the functionality in this direction because I prefer to keep this plugin simple.
Then what's the solution?
Shortcode for Geo Filtering
Well, this plugin has much extendability enough to satisfy the demand. You can embed the following snippet for shortcode into your
functions.php to manage the content:
The usage of the shortcode
[ip-location-block] is as follows:
And there’s a tweak to keep the whitelist or blacklist of country code in “Front-end target settings”. You need 2 steps to do this:
- Check “Block by country” and specify the others. Then “Save Changes”.
- Uncheck “Block by country” and “Save Changes” once again.
Have fun 😄
Leave a Reply