Title: IP2Location Tags
Author: IP2Location
Published: <strong>2009 年 11 月 16 日</strong>
Last modified: 2025 年 12 月 3 日

---

搜索插件

![](https://ps.w.org/ip2location-tags/assets/banner-772x250.png?rev=1034292)

![](https://ps.w.org/ip2location-tags/assets/icon-128x128.png?rev=2121921)

# IP2Location Tags

 作者：[IP2Location](https://profiles.wordpress.org/ip2location/)

[下载](https://downloads.wordpress.org/plugin/ip2location-tags.2.13.7.zip)

 * [详情](https://cn.wordpress.org/plugins/ip2location-tags/#description)
 * [评价](https://cn.wordpress.org/plugins/ip2location-tags/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/ip2location-tags/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/ip2location-tags/#developers)

 [支持](https://wordpress.org/support/plugin/ip2location-tags/)

## 描述

IP2Location Tags 可帮助您通过 IP 地址查找根据不同国家和地区的地理位置向网站访问者
提供特定内容。

该插件提供了一种相对简单的方法来检测访问者的 IP 地址并将其转换为地理位置信息，然后
让访问者更好地参与与他们最相关的本地化信息或内容。

主要特征

 * Displays visitor’s’ information such as
    - Country code
    - 国家名称
    - 国旗
    - 地区名字
    - 城市名称
    - 纬度和经度
    - 邮政编码
    - ISP
    - 域名
    - 时区
    - 连接速度
    - IDD 代码
    - 区号
    - 气象站代码 & 名字
    - MNC，MCC，手机运营商名字
    - 海拔
    - 使用类型
    - Address type
    - Category
 * 根据国家或地区自定义页面内容
 * 支持 IPv4 和 IPv6

此重定向插件同时支持 IP2Location IP 地理定位 BIN 数据和 Web 服务来查找 IP 地址地理位置。
如果您使用的是 BIN 数据，您可以使用设置页面上的向导每月更新一次 BIN 数据，以获得
最准确的结果。或者，您也可以使用以下链接手动下载和更新 BIN 数据文件：

BIN 文件下载：[IP2Location 商用数据库](http://ip2location.com) | [IP2Location LITE 数据库（免费版本）](http://lite.ip2location.com)

如果您正在使用 IP2Location IP 地理位置网络服务，请浏览 [IP2Location Web Service](http://www.ip2location.com/web-service)
以获取详情。

#### 使用 Variable Tag 获取访问者的位置信息

_使用例子_

显示访客的 IP 地址，国家名字，地区名字和城市名字。
 _Your IP is {ip:ipAddress}_ 
_You are in {ip:countryName}, {ip:regionName}, {ip:cityName}_

#### 地理定位：使用 IP2Location Tag 自定义帖子内容

**向特定国家显示内容的语法**
 _[ip:XX[,XX]..[,XX]]Your content here.[/ip]_ 备注：
XX 是两个字符的 ISO-3166 国家/地区代码。

_例子_
 仅向美国或加拿大访问者显示内容。 _[ip:US,CA]Only visitors from United States
or Canada can view this line.[/ip]_

**向特定国家和地区显示内容的语法**
 _[ip:XX:YY[,XX:YY]..[,XX:YY]]Your content here.[/
ip]_ 备注：XX 是两个字符的 ISO-3166 国家/地区代码，而 YY 是 ISO-3166-2 细分代码。

_例子_
 _仅向加利福尼亚或纽约访客显示内容。_ _[ip:US:CA,US:NY]Only visitors from
California or New York can view this line.[/ip]_

**从特定国家隐藏内容的语法**
 _[ip:*,-XX[,-XX]..[,-XX]]Your content here.[/ip]_ 
备注：XX 是两个字符的 ISO-3166 国家/地区代码。

_例子_
 所有除了来自越南外的访客将能够看到这条信息。 _[ip:*,-VN]All visitors will
be able to see this line except visitors from Vietnam.[/ip]_

**从特定国家和地区隐藏内容的语法**
 _[ip:*,-XX:YY[,-XX:YY]..[,-XX:YY]]Your content
here.[/ip]_ 备注：XX 是两个字符的 ISO-3166 国家/地区代码，而 YY 是 ISO-3166-2 细
分代码。

_例子_
 所有除了来自加利福尼亚外的访客将能够看到这条信息。 _[ip:*,-US:CA]All visitors
will be able to see this line except visitors from California.[/ip]_

#### 更多的信息

请访问位于 [https://www.ip2location.com](https://www.ip2location.com)的我们。

## 屏幕截图

 * [[
 * IP2Location Tags 设置页面
 * [[
 * IP2Location Tags 简码显示

## 安装

 1. 上传 `ip2location` 文件夹到 `/wp-content/plugins/` 目录。
 2. 通过 WordPress 的“插件”菜单以激活本插件。
 3. 在设置页面下载最新的 BIN 数据库。
 4. 您现在可以开始使用 IP2Location tag 来自定义您的文章内容。

请注意此插件需要最少 **PHP 版本 5.4**。

## 评价

![](https://secure.gravatar.com/avatar/3a29981ec26713acf3c9e1fb4c00078a755a652a85684547eee3cd0c783f5f1a?
s=60&d=retro&r=g)

### 󠀁[Just what I needed!](https://wordpress.org/support/topic/just-what-i-needed-1366/)󠁿

 [deancarlton](https://profiles.wordpress.org/deancarlton/) 2025 年 3 月 10 日

I needed to show content for certain countries only – and show everyone else alternative
content without indicating I was Geo Blocking – did the job easily in a few minutes!

![](https://secure.gravatar.com/avatar/ac98ca1dafe795b7d627ee9b76d51e6456e06f93361e17b5d7870b8baf8a36ce?
s=60&d=retro&r=g)

### 󠀁[Rolls its own shortcode system](https://wordpress.org/support/topic/rolls-its-own-shortcode-system/)󠁿

 [motivmedia](https://profiles.wordpress.org/motivmedia/) 2023 年 6 月 15 日

I was wondering why I couldn’t get it to work within CF7 forms (yes, I know how 
to allow third-party shortcodes in CF7). Out of curiosity I looked at source code
as the shortcode syntax looked unusual. Thing is, I searched over the whole plugin
dir for add_shortcode and there wasn’t a single match… looking closer, for some 
reason the developer decided it to be a good idea to roll their own shortcode system
which just won’t work at the same places as regular shortcodes. Regular shortcodes
would have been the perfect solution to make this work reliably, but somehow that
was off the table. And just to be clear: This is an issue purely of this plugin.
Its sister plugin IP2Location Country Blocker works great, which speaks for the 
provider’s database.

![](https://secure.gravatar.com/avatar/ceb59a18f6803a4c9921aeea99399959d054cea320ba9670f3b9f97136bd1ba7?
s=60&d=retro&r=g)

### 󠀁[The best Geo content plugin](https://wordpress.org/support/topic/the-best-geo-content-plugin/)󠁿

 [laurawen912](https://profiles.wordpress.org/laurawen912/) 2021 年 1 月 1 日

i really love this plugin

![](https://secure.gravatar.com/avatar/ddc4f92fe9b296cde5f94d0200fe94307bc22c9d21ce65e920089172996ea2ea?
s=60&d=retro&r=g)

### 󠀁[Not Working](https://wordpress.org/support/topic/not-working-3338/)󠁿

 [juliocofre](https://profiles.wordpress.org/juliocofre/) 2020 年 7 月 30 日 1 回复

this plugin doesn’t work, even if you update the database, it still doesn’t work

![](https://secure.gravatar.com/avatar/5be374f96332836be4b3d830df3f7e25a31c42a5474b47b61749de4e8f6d8a76?
s=60&d=retro&r=g)

### 󠀁[Just what i needed !](https://wordpress.org/support/topic/just-what-i-needed-988/)󠁿

 [0builder](https://profiles.wordpress.org/0builder/) 2020 年 6 月 27 日

Works as expected 🙂

![](https://secure.gravatar.com/avatar/4834db2b3fc38e4838a592d4fdd36ac4677742c0f15298bff9b6900bfda3dec0?
s=60&d=retro&r=g)

### 󠀁[Perfect](https://wordpress.org/support/topic/perfect-3967/)󠁿

 [fafani](https://profiles.wordpress.org/fafani/) 2017 年 4 月 18 日

Plugin works with wordpress 4.7.3 Thanks you saved my time

 [ 阅读所有9条评价 ](https://wordpress.org/support/plugin/ip2location-tags/reviews/)

## 贡献者及开发者

「IP2Location Tags」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ IP2Location ](https://profiles.wordpress.org/ip2location/)

[帮助将「IP2Location Tags」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/ip2location-tags)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/ip2location-tags/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/ip2location-tags/)，或通过[RSS](https://plugins.trac.wordpress.org/log/ip2location-tags/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/ip2location-tags/)。

## 更新日志

 * 2.13.7 Tested up to WordPress 6.9.
 * 2.13.6 Security fixes.
 * 2.13.5 Tested up to WordPress 6.8.
 * 2.13.4 Fixed web service validation error when insert both IP2Location and IP2Location.
   io keys.
 * 2.13.3 Tested up to WordPress 6.7.
 * 2.13.1 Tested up to WordPress 6.5.1.
 * 2.13.0 Added ip2location.io web service support.
 * 2.12.7 Tested up to WordPress 6.4
 * 2.12.4 Tested up to WordPress 6.1.
 * 2.12.3 Tested up to WordPress 6.0.
 * 2.12.2 Fixed missing country flags.
 * 2.12.1 Enhanced checking.
 * 2.12.0 Updated IP2Location library.
 * 2.11.1 Tested up to WordPress 5.9.
 * 2.11.0 Added new address type and category fields.
 * 2.10.7 修复了弹出没有关闭的问题。
 * 2.10.6 测试到 WordPress 5.8。
 * 2.10.5 修复了网络服务的查找问题。
 * 2.10.4 测试到 WordPress 5.7。
 * 2.10.3 修复了一些用户的文件权限问题。
 * 2.10.2 修复了读取数据库文件的错误。
 * 2.10.1 移除了内置数据库。
 * 2.10.0 添加了设置向导。
 * 2.9.3 修复了当结果不可用时的错误。
 * 2.9.2 测试到WordPress 5.6。
 * 2.9.1 移除了已弃用的函数。
 * 2.9.0 更新了文件结构以将 Composer 用于 IP2Location 库。
 * 2.8.10 测试到 WordPress 5.5。
 * 2.8.9 修复了弃用警告。
 * 2.8.8 测试到 WordPress 5.4。
 * 2.8.7 修复了错别字。
 * 2.8.6 小修复。
 * 2.8.5 添加了反馈请求。
 * 2.8.4 测试了 WordPress 5.3.2。
 * 2.8.3 升级了 IP2Location 库到 8.1.0。
 * 2.8.2 更新了文档链接。
 * 2.8.1 测试到了 WordPress 5.1.1。
 * 2.8.0 升级了 IP2Location API 到 v2。
 * 2.7.1 添加了当 IP2Location 数据库遗失或损坏时的错误信息。
 * 2.7.0 添加了调试日志。
 * 2.6.1 小改动。
 * 2.6.0 IP2Location 数据库更新更改为使用下载令牌。
 * 2.5.1 修复了安装多个 IP2Location 插件时的冲突问题。
 * 2.5.0 使用 IP2Location PHP 8.0.2 库进行查找。
 * 2.4.9 支持 countryFlag 功能。
 * 2.4.8 修复了卸载功能。
 * 2.4.7 防止在停用/激活插件时丢失设置。
 * 2.4.6 修复了小漏洞。
 * 2.4.5 使用最新的 IP2Location 库并更新设置页面。
 * 2.4.4 测试到 WordPress 4.4。
 * 2.4.3 修复了在本地机器测试时的问题。
 * 2.4.2 修复了匹配区域或州属时的问题。
 * 2.4.11 使用最新的 IP2Location 库进行查找。
 * 2.4.10 修复关闭粘性信息面板问题。
 * 2.4.0 修复了多个性能问题。添加了 IP2Location 网络服务支持。
 * 2.3.3 支持根据地区或州属的内容的定制。
 * 2.3.2 修复了小工具的兼容问题。
 * 2.3.1 修复了小问题和 WordPress 标准。
 * 2.3.0 修复了与其他 IP2Location 插件的冲突。
 * 2.2.0 支持在设置页面下载数据库。支持括号[]来定义<&lgt;之外的标签规则，以解决被
   wordpress当作script标签的问题。
 * 2.1.0 初始版本

## 额外信息

 *  版本 **2.13.7**
 *  最后更新：**6 月前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 2.0 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  语言
 * [English (US)](https://wordpress.org/plugins/ip2location-tags/)
 * 标签
 * [geo-targeting](https://cn.wordpress.org/plugins/tags/geo-targeting/)[geolocation](https://cn.wordpress.org/plugins/tags/geolocation/)
   [ip2location](https://cn.wordpress.org/plugins/tags/ip2location/)
 *  [高级视图](https://cn.wordpress.org/plugins/ip2location-tags/advanced/)

## 评级

 3.7 星（最高 5 星）。

 *  [  6 条 5 星评价     ](https://wordpress.org/support/plugin/ip2location-tags/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/ip2location-tags/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/ip2location-tags/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/ip2location-tags/reviews/?filter=2)
 *  [  3 条 1 星评价     ](https://wordpress.org/support/plugin/ip2location-tags/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/ip2location-tags/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/ip2location-tags/reviews/)

## 贡献者

 *   [ IP2Location ](https://profiles.wordpress.org/ip2location/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/ip2location-tags/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://www.ip2location.com)