Insight Things

A scientific blog revealing the hidden links which shape our world

Increase accuracy of Custom Content by Country (by iControlWP)

This blog uses Custom Content by Country (by iControlWP) to localize content. However, my tests with geopeeker.com were disappointing. The result was always U. S. related instead of the countries the servers were actually situated in. It turned out that it’s not a matter of the plugin itself (it’s fantastic!), but the data on IPs and countries is weak. The good thing is that I could increase accuracy by replacing the IP data with those from ip2location. Here is how I achieved it!

Go to your database administration tool (I use phpMyAdmin). There, select the table ip2nation, go to operations and truncate the table like shown below (please excuse that my hoster provides a German interface). Check whether you really selected the correct options!

How to truncate ip2nation

How to truncate ip2nation

Now download theย IP data which I already modified to suit our needs. Import the content of the CSV file to the still existing table ip2nation. This is simple, but see a screenshot below.

Import new IP data

Import new IP data

This should improve accuracy of Custom Content by Countries. Try again with geopeeker.com and be happy ๐Ÿ˜€

4 Comments

  1. Hi Jan,

    I’m the author of the Content by Content country… I’m curious, could you possible supply us with the SQL import files in the same format. I’d be happy to use a better DB, but I’d need the data prepared in the correct format.

    Is this possible? Please feel free to email me directly to chat about it!

    Thanks!
    Paul.

  2. This worked perfectly, thanks for putting this together ๐Ÿ˜€

  3. Jan, this is an interesting article, and I want to follow the steps you’ve provided … however, this article is now 3 years old so I want to use the up to date version of the ip2location database.

    Can you please describe the steps needed to prepare the ip2location data for importing into the ip2nations table?

Leave a Reply

Your email address will not be published.

*

© 2024 Insight Things

Theme by Anders NorenUp ↑