IP2Location Tags 可帮助您通过 IP 地址查找根据不同国家和地区的地理位置向网站访问者提供特定内容。
该插件提供了一种相对简单的方法来检测访问者的 IP 地址并将其转换为地理位置信息,然后让访问者更好地参与与他们最相关的本地化信息或内容。
主要特征
- Displays visitor’s’ information such as
- Country code
- 国家名称
- 国旗
- 地区名字
- District name
- 城市名称
- 纬度和经度
- 邮政编码
- ISP
- 域名
- 时区
- 连接速度
- IDD 代码
- 区号
- Weather station code & name
- MNC,MCC,手机运营商名字
- ASN
- AS name, AS domain, AS usage type, AS CIDR
- 海拔
- 使用类型
- Address type
- Category
- 根据国家或地区自定义页面内容
- 支持 IPv4 和 IPv6
This plugin supports both IP2Location IP geolocation BIN data and the
IP2Location.io web service for IP geolocation lookup. If you are using the BIN data, you can update the BIN data every month by using the wizard on the settings page for the most accurate result. Alternatively, you can also manually download and update the BIN data file using the below links:
BIN file download:
IP2Location Commercial database |
IP2Location LITE database (free edition)
If you are using the
IP2Location.io web service, please visit
IP2Location.io for details.
使用 Variable Tag 获取访问者的位置信息
Usage example
Display visitor's IP address, country name, region name and city name.
Your IP is {ip:ipAddress}
You are in {ip:countryName}, {ip:regionName}, {ip:cityName}
地理定位:使用 IP2Location Tag 自定义帖子内容
Syntax to show content for specific country
[ip:XX[,XX]..[,XX]]Your content here.[/ip]
Note: XX is a two-character ISO-3166 country code.
Example
To show the content for United States or Canada visitors only.
[ip:US,CA]Only visitors from United States or Canada can view this line.[/ip]
Syntax to show content for specific country and region
[ip:XX:YY[,XX:YY]..[,XX:YY]]Your content here.[/ip]
Note: XX is a two-character ISO-3166 country code and YY is a ISO-3166-2 sub-division code.
Example
To show the content for California or New York visitors only.
[ip:US:CA,US:NY]Only visitors from California or New York can view this line.[/ip]
Syntax to hide the content from specific country
[ip:*,-XX[,-XX]..[,-XX]]Your content here.[/ip]
Note: XX is a two-character ISO-3166 country code.
Example
All visitors will be able to see the line except visitors from Vietnam.
[ip:*,-VN]All visitors will be able to see this line except visitors from Vietnam.[/ip]
Syntax to hide the content from specific country and region
[ip:*,-XX:YY[,-XX:YY]..[,-XX:YY]]Your content here.[/ip]
Note: XX is a two-character ISO-3166 country code and YY is a ISO-3166-2 sub-division code.
Example
All visitors will be able to see the line except visitors from California.
[ip:*,-US:CA]All visitors will be able to see this line except visitors from California.[/ip]
更多的信息
Please visit us at
https://www.ip2location.com
- Upload
ip2location folder to the /wp-content/plugins/ directory.
- 通过 WordPress 的“插件”菜单以激活本插件。
- 在设置页面下载最新的 BIN 数据库。
- 您现在可以开始使用 IP2Location tag 来自定义您的文章内容。
Please take note that this plugin requires minimum
PHP version 7.2.