A Google Groups thread has a webmaster who has been receiving a lot of rogue spider attacks from the Africa region. He wants to go as far as ban the whole continent of Africa. But he is concerned that by doing so, he will also hurt his Google rankings.

It is actually not all that uncommon for network administrators to block specific regions of web traffic. In fact, I believe my office blocks the Asia and Africa regions from entering our network (not this site, but my office network). We pretty much banned that whole region, because we have no reason to allow those regions in (in most cases, but things have come up).

Would blocking the whole Africa hurt this guys search rankings in Google?

Googler, JohnMu, stepped in to say that by blocking an entire region, it would "be considered cloaking" and would be against Google's Webmaster Guidelines. Got that, if you block specific regions of traffic, like everyone outside of the US, that is cloaking and against Google's guidelines.

Do I agree with this policy? In many cases, no. If your site is local in nature and having visitors from outside a specific region doesn't make sense for your bandwidth bill, then it is up to the site owner to make that call. Of course, there may be users outside of a specific region that are your target audience, but in many cases people take the route of percentages and are willing to have some collateral damage.

John does give some excellent advice, advice that is not as easy as blocking a whole region via the Router but good advice in any event. He said, instead you should "add blocks based on the user's activity, not based on his location." Of course, then you need to build algorithms and software that detects certain activities and blocks them based on that activity. More tips on that type of detection here.

Forum discussion at Google Groups.

Update: Danny Sullivan and I talked to Google about this. Googles revised statement on this is summed up in a comment Danny, where Google said:

As long as the web server always blocks IPs from (say) Africa, it's not doing anything special/different for Googlebot, and so it wouldn't be considered cloaking, but geolocation instead.

Plus, Matt Cutts of Google gives a little more on what happened here:

Yup, what Danny said. The downside of doing a lot more talking to webmasters and site owners is that sometimes we'll misspeak, but I'd much rather have that problem and sometimes need to clarify than not be talking to webmasters as much. Barry, thanks for highlighting this, and JohnMu, thanks for always being willing to answer questions in the Google webmaster discussion group.

We have posted a new article on this retraction over here.