Title: IP2Location Variables
Author: IP2Location
Published: <strong>2013 年 9 月 13 日</strong>
Last modified: 2026 年 6 月 15 日

---

搜尋外掛

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

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

# IP2Location Variables

 由 [IP2Location](https://profiles.wordpress.org/ip2location/) 開發

[下載](https://downloads.wordpress.org/plugin/ip2location-variables.2.9.10.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/ip2location-variables/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/ip2location-variables/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/ip2location-variables/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/ip2location-variables/#developers)

 [技術支援](https://wordpress.org/support/plugin/ip2location-variables/)

## 外掛說明

This useful library makes it easy to conveniently find website visitors location
and provides geographic information based on IP address lookup. It also can be used
to display geo-data info in posts for specific locations and to help you create 
geo-target marketing campaigns.

It is a library derived from https://www.ip2location.com/developers/php but works
as a WordPress plugin to simplify the setup and ease the integration work. It supports
both the IPv4 and IPv6 address.

Below are the geolocation information you can retrieve from this library:
 * Country
code * Country name * Country flag * Region name * City name * Latitude and longitude*
ZIP code * ISP * Domain name * Time zone * Net speed * IDD code * Area code * Weather
station code & name * MNC, MCC, mobile carrier name * Elevation * Usage type * Address
type * Category

This plugin supports both IP2Location IP geolocation BIN data and web service for
geolocation queries. 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](https://www.ip2location.com)
| [IP2Location LITE database (free edition)](https://lite.ip2location.com)

If you are using the IP2Location IP geolocation web service, please visit [IP2Location Web Service](https://www.ip2location.com/web-service)
for details.

#### Usage

Call the function ip2location_get_vars() in any pages, plugins, or themes to retrieve
IP2Location variables. The variables are returned in object. To use lookup for a
custom IP, use ip2location_get_vars(‘IP_ADDRESS’);

#### More Information

Please visit us at [https://www.ip2location.com](https://www.ip2location.com)

## 安裝方式

We always recommend the automatic installation via the plugin menu. In case you 
having the difficulties to do so, below are the manual install steps:

 1. Upload `ip2location` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. You can now start using IP2Location Variables to customize your contents.

Please take note that this plugin requires minimum **PHP version 5.4**.

## 使用者評論

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

### 󠀁[Does not work.](https://wordpress.org/support/topic/does-not-work-786/)󠁿

 [c4altoimpacto](https://profiles.wordpress.org/c4altoimpacto/) 2017 年 5 月 2 日
1 則留言

Does not work properly, returns NULL.

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

### 󠀁[Working as intended](https://wordpress.org/support/topic/working-as-intended-8/)󠁿

 [sprudhomme](https://profiles.wordpress.org/sprudhomme/) 2016 年 9 月 3 日

I’ve been using this plugin for the past few months, allowing dynamic templates 
and content depending on the country code of the users. No issues so far!

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

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

 [Olegipst](https://profiles.wordpress.org/olegipst/) 2016 年 9 月 3 日

Doesn’t work, returns NULL

 [ 閱讀全部 4 則使用者評論 ](https://wordpress.org/support/plugin/ip2location-variables/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈IP2Location Variables〉的開發相關工作。

參與者

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

[將〈IP2Location Variables〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/ip2location-variables)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/ip2location-variables/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/ip2location-variables/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/ip2location-variables/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/ip2location-variables/)。

## 變更記錄

 * 2.9.10 Tested up to WordPress 7.0.
 * 2.9.9 Tested up to WordPress 6.9.
 * 2.9.8 Security fixes.
 * 2.9.7 Tested up to WordPress 6.8.
 * 2.9.6 Fixed CSRF vulnerabilities.
 * 2.9.5 Fixed web service validation error when insert both IP2Location and IP2Location.
   io keys.
 * 2.9.4 Tested up to WordPress 6.7.
 * 2.9.3 Sanitized input fields.
 * 2.9.2 Tested up to WordPress 6.6.
 * 2.9.1 Tested up to WordPress 6.5.1.
 * 2.9.0 Added ip2location.io web service support.
 * 2.8.7 Tested up to WordPress 6.4
 * 2.8.5 Fixed connection error.
 * 2.8.4 Tested up to WordPress 6.1.
 * 2.8.3 Tested up to WordPress 6.0.
 * 2.8.2 Enhanced checking.
 * 2.8.1 Tested up to WordPress 5.9.
 * 2.8.0 Added new address type and category fields.
 * 2.7.3 Tested up to WordPress 5.8.
 * 2.7.2 Tested up to WordPress 5.7.
 * 2.7.1 Tested up to WordPress 5.6.
 * 2.7.0 Minor bug fixes and added supports up to DB24.
 * 2.6.0 Updated file structures to use composer for IP2Location libraries.
 * 2.5.12 Tested with WordPress 5.5.
 * 2.5.11 Fixed parsing issues.
 * 2.5.10 Tested with WordPress 5.4.
 * 2.5.9 Increased download timeout.
 * 2.5.8 Fixed typo.
 * 2.5.7 Minor fixes.
 * 2.5.6 Added feedback request.
 * 2.5.5 Tested with WordPress 5.3.2.
 * 2.5.4 Fixed variable errors when result not found.
 * 2.5.3 Updated IP2Location library.
 * 2.5.2 Updated documentation links.
 * 2.5.1 Tested up to WordPress 5.1.1.
 * 2.5.0 Upgraded IP2Location API to v2.
 * 2.4.0 Added debug log.
 * 2.3.1 Minor changes.
 * 2.3.0 IP2Location database update changed to use download token.
 * 2.2.0 Able to lookup specific IP address.
 * 2.1.1 Fixed conflicts when multiple IP2Location plugins installed.
 * 2.1.0 Use IP2Location PHP 8.0.2 library for lookup.
 * 2.0.8 Use latest IP2Location library for lookup.
 * 2.0.7 Fixed close sticky information panel issue.
 * 2.0.6 Use latest IP2Location library and updated the setting page.
 * 2.0.5 Fixed error when creating admin option.
 * 2.0.4 Fixed uninstall hook warning message.
 * 2.0.3 Fixed uninstall hook.
 * 2.0.2 Fixed empty variable on first load.
 * 2.0.1 Tested with WordPress 4.4.
 * 2.0.0 Added suport to IP2Location Web Service. Rewrote the codes behind.
 * 1.1 Support automated bin download and server variables for IP2Location.
 * 1.0 Initial release

## 中繼資料

 *  版本 **2.9.10**
 *  最後更新 **2 週前**
 *  啟用安裝數 **100+**
 *  WordPress 版本需求 ** 2.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.0**
 *  語言
 * [English (US)](https://wordpress.org/plugins/ip2location-variables/)
 * 標籤:
 * [geo-targeting](https://tw.wordpress.org/plugins/tags/geo-targeting/)[geolocation](https://tw.wordpress.org/plugins/tags/geolocation/)
   [ip2location](https://tw.wordpress.org/plugins/tags/ip2location/)[targeted content](https://tw.wordpress.org/plugins/tags/targeted-content/)
 *  [進階檢視](https://tw.wordpress.org/plugins/ip2location-variables/advanced/)

## 評分

 2.3 星，滿分為 5 星

 *  [  1 個 5 星使用者評論     ](https://wordpress.org/support/plugin/ip2location-variables/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/ip2location-variables/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/ip2location-variables/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/ip2location-variables/reviews/?filter=2)
 *  [  2 個 1 星使用者評論     ](https://wordpress.org/support/plugin/ip2location-variables/reviews/?filter=1)

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

[查看全部使用者評論](https://wordpress.org/support/plugin/ip2location-variables/reviews/)

## 參與者

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

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/ip2location-variables/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](http://www.ip2location.com)