Make WordPress Core

#58698 closed enhancement (wontfix)

Request for Geo-Blocking as an Integral Feature of WordPress in an Upcoming Release

Reported by: rcnyc's profile rcnyc Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.2.2
Component: Security Keywords: changes-requested
Focuses: privacy Cc:

Description

WordPress, first of all, thank you so much for such a wonderful resource. With that being said, I am requesting a feature that I feel needs to be a critical component of WordPress.

Please, Please, PLEASE have a feature in which a WordPress blog is only accessible/viewable to one's country by default, and you have to opt-in to publish to the world. Right now, I'm currently using IP2Location Country Blocker, and it's great, but I would like this integrated into WordPress as a core feature (within reason, of course).

It can work like this:

When new WP installation is launched--or new update implemented-- user is prompted into deciding which countries they would like the site to be viewable to, both on the front and backend. They can publish to their country, to specific countries, or to the world (which is the default right now).

The reason why I’m asking this is that I didn’t realize what a problem it was to have the “world” be the default audience until 2-3 years ago, and now I’m seeing that this needs to be a critical feature. I am not going to give specifics as to why I want this, but suffice it to say, if someone is launching a community blog for, say, residents of Las Vegas, San Francisco, Chicago or wherever, the entire world does not need to be the default audience for this blog. People from the UK, Eastern Europe, New Zealand, the West Indies, don't need to not only be actively viewing your site but feeling compelled to comment and troll, or argue with you as if they were from your hometown.

I have found, more and more, that most of the foreign nationals to my blog have been trolls from specific countries to the point where I just want those countries blocked, as opposed to just IP blocking troublemakers.

So, this is what I'd like to request. I can always continue using a plugin but I think adding this would be openly welcomed by the WordPress community and a major enhancement to the functionality of WP.

Change History (2)

#1 @ayeshrajans
10 months ago

They can publish to their country, to specific countries, or to the world (which is the default right now).

It's rather that WordPress does not apply any restrictions at all, rather than "publishing it the the world", except for the password-protected pages or other plugin-induced restrictions.

WordPress can only run in the PHP layer, which is several layers inside of a page request-response cycle. The request is by then passed through the network/firewall layer, load balancer (if configured), and the web server. All of which are more suitable than the latter, to effectively block an IP address in the interest of saving system resources. The complexity with network and load balancing layer means that WordPress may not even see IP address of the user.

Additionally, the IP address itself is not enough to determine the user's country or the location. It needs to refer a database of IP ranges and ASNs, and then cross-reference them to determine the location. These data, while I argue should be, are not easily accessible in programmable ways, so has to be relied on third party (and often commercial) databases such as Maxmind. Even the free services available won't cut it for web sites in the scale of WordPress as a whole.

Given WordPress's GPL licensing, and ethos in community and open source, I would say that we should not introduce any GeoIP restrictions at all. It can be easily outdated or inaccurate, and I don't think the additional work to implement and maintain is not worth it, especially considering it has to be a lot flexible to be adaptable by the wide range of configurations.

#2 @peterwilsoncc
10 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Severity changed from critical to normal
  • Status changed from new to closed

Hi @rcnyc and welcome to trac!

Unfortunately this feature isn't something that can be included in WordPress Core software.

At a technical level, as mentioned on the plugin page, this kind of feature prevents the use of caching software. For small sites, such as personal or local-area focused blogs, this isn't a problem. For large sites, such as wordpress.org, caching is essential in order for the sites to remain usable by visitors.

On a product design level, I don't think it's a feature that has wide enough usage requirements. The far majority of sites are intended to be accessed globally so including a niche feature like Geo-targeting in WordPress would require contributors maintain features few people use.

As a guide, WordPress tries to include features that will be useful for 80% of sites, see the lean clean and mead section of the WordPress philosophy.

I wish you luck getting trolls and other unhelpful visitors under control, if you ask a question in the support forums you may be able to find others with suggestions on plugins to use to prevent this.

I'm going to close this ticket off as wontfix, it's the slightly unfriendly term trac uses to indicate that a feature is unplanned.

Note: See TracTickets for help on using tickets.