This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

PHP Browser Detection


Version 3 adds support for is_tablet(), is_desktop(), and is_browser() as well as numerous bug fixes and code improvements. As of version 3.1.2 automatic updates of browscap.ini are disabeld until we can deal with memory usage issues.

PHP Browser Detection is a WordPress plugin used to detect a user’s browser. It can be used to send conditional CSS files for Internet Explorer, display different content or custom messages anywhere on the page, or to swap out Flash for an image for iPhones.

Template Tags:

Test for specific browsers:

$version is optional. Include a major version number, a single integer – 3,4,5, etc… Or leave it empty to test for any version.

<?php if(is_firefox($version)) { /* your code here */ }; ?>

<?php if(is_safari($version)) { /* your code here */ }; ?>

<?php if(is_chrome($version)) { /* your code here */ }; ?>

<?php if(is_opera($version)) { /* your code here */ }; ?>

<?php if(is_ie($version)) { /* your code here */ }; ?>

<?php if(is_browser($name, $version)) { /* your code here */ }; ?>

Check for mobile, tablet, iPhone, iPad, iPod, etc…

<?php if(is_desktop()) { /* your code here */ }; ?>

<?php if(is_tablet()) { /* your code here */ }; ?>

<?php if(is_iphone($version)) { /* your code here */ }; ?>

<?php if(is_ipad($version)) { /* your code here */ }; ?>

<?php if(is_ipod($version)) { /* your code here */ }; ?>

<?php if(is_mobile()) { /* your code here */ }; ?>

Check for greater than / less than a specific version…

Less than or equal to Firefox 19:
< ?php if(is_firefox() && get_browser_version()

Less than or equal to IE 10:
< ?php if(is_ie() && get_browser_version()

Greater than or equal to Safari 4:
= 4) { /* your code here */ }; ?>

these are just a few examples, but this syntax will work for any browser or version.

Check specific versions…

Is the browser IE6?

Is the browser IE10?

Or you can get all the info and do what you want with it:

Get just the name…

<?php $browser_name = get_browser_name(); ?>

Get the full version number – 3.2, 5.0, etc…

<?php $browser_version = get_browser_version(); ?>

Or get it all in array…

<?php $browser_info = php_browser_info(); ?>


Test for specific browsers:

[is_browser name="chrome" version="45"]
<p>You are using Chrome 45 or above.</p>

Output all browser info:


انسٹال کرݨ

  1. Automatically install through the Plugin Browser or…
  2. Upload entire php-browser-detection folder to the /wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress.

ہرہک دے سوال

PHP Browser Detection is reporting the version of Chrome (or any pother browser) as “0.0”

This means the local cached copy of the browscap.ini user agent database is out of date. You can fix this by updating the file yourself manually, or wait for a new release of the plugin. To update the file, download the most recent version here: and save it over the one bundled with the plugin php-browser-detection/cache/browscap.ini

I got a fatal error on activation. What gives?

This most likely means your web host is running a very old version of PHP. As of version 3.0, only PHP 5.3 and above are supported. You can ask your host to upgrade PHP for you.


ستمبر 3, 2016
Of course this can be used to provide different CSS for firefox, chrome, and ie/Edge browsers. But I’m also using it to distinguish between emulations of different generations of ie browsers. A super-useful plugin.
ستمبر 3, 2016
Awesome plugin giving users a lot of flexibility!
ستمبر 3, 2016 1 reply
I love this plugin! Thanks guys. Would be nice to have shortcodes as well – to be able to write some content for desired browsers/ platform. Anyway – head up and keep rockin’
سارے 16 ریویو پڑھو

Contributors & Developers

“PHP Browser Detection” is open source software. The following people have contributed to this plugin.

حصہ پاوݨ آلے

“PHP Browser Detection&#8221 دا آپݨی زبان وچ ترجمہ کرو۔

ڈیویلپمنٹ وچ دلچسپی ہے؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

تبدیلی لاگ


  • Add missing include file
  • Confirm filters aren’t working (needs refactor)


  • Added shortcodes


  • Bugfix for 3.1.5


  • Updated Browscap to 2.0.5
  • Re-enable auto-updates
  • Added filter to turn off auto updates for host with low memory.
  • Added FAQ about manually updating.
  • Added global variable for $browser_info = php_browser_info();


  • Updated default browscap.ini


  • Updated default browscap.ini
  • Migrated Browscap.php to use asgrim’s fork
  • Added ID param for tests


  • Disabled auto updates because of memory problems
  • Minor bugfixes
  • Add icons for WP 4.0 plugin installer
  • Added development repo on
  • Updated Browscap library


  • Fix for is_desktop()
  • Added is_true


  • Updated default browscap.ini
  • Changed version of browscap to utilize less memory
  • Updated Browscap to version 2.0 from 2b


  • Added FAQ section


  • Browscap.ini database auto-updates!
  • Browscap database caching!
  • Added is_tablet()
  • Added is_desktop()
  • Added is_browser()
  • Various detection fixes (incl. Opera Mini and IE Mobile)
  • Updated tests
  • Refactored plugin structure
  • Now utilizes Browser Capabilities PHP Project by Garet Jax


  • updated php_browser_detection_browscap.ini to version 5027


  • updated readme


  • updated php_browser_detection_browscap.ini to version 5022
  • bugfixes


  • updated php_browser_detection_browscap.ini to version 5020
  • bugfixes
  • additional testing and QA


  • updated php_browser_detection_browscap.ini to version 5020 (custom version)
  • minor code cleanup
  • added tests.php to check all plugin features
  • added additional usage examples to readme.txt
  • deprecated is_ie9() functions in favor is is_ie(9), etc.
  • fixed issue with is_ipod
  • fixed issue with is_mobile
  • fixed issue with detecting Android 4.2.*
  • fixed issue with boolean values
  • other minor bug fixes reported on


  • updated php_browser_detection_browscap.ini to version 5016


  • updated php_browser_detection_browscap.ini to version 5004


  • updated php_browser_detection_browscap.ini to version 4911


  • fixed path info to work with ‘mu-plugins’ folder, version 2.0 didn’t know how to find it.
  • better recognition of iPad and iPhone with iOS 4


  • Added tests for iPad, iPod, Chrome, Opera
  • Added ability to test for any version for each browser
  • Added ability to get browser name and get browser version


  • fixed the lesser than statements.
  • They had been looking for lesser than or equal to
  • Fixed the is_safari() statement.


  • Fixed error on line 156 preventing activation