mobble provides mobile related conditional functions for your site. e.g. is_iphone(), is_mobile() and is_tablet().

CSS media queries are great for creating responsive web designs but they do not always provide enough control. There are times when not all of the content, JavaScript or CSS on a page is relevant for a particular device. With the mobble functions you can make these kind of tweaks to your theme.

mobble can also add device information to the body class of your theme allowing you to easily target your CSS for different gadgets.

a plugin by Scott Evans


  • Code example - loading different navigations for mobile and desktop.
  • mobble settings screen for enabling/disabling the body class.


To install this plugin:

  1. Upload the mobble folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. You can now use <?php is_mobile(); is_tablet(); // etc ?> functions in your themes/templates
  4. If you want you can also disable the device specific body classes in the WordPress Admin->Settings->mobble setting section


What functions are available?

The most useful ones are:

is_handheld(); // any handheld device (phone, tablet, Nintendo)
is_mobile(); // any type of mobile phone (iPhone, Android, etc)
is_tablet(); // any tablet device
is_ios(); // any Apple device (iPhone, iPad, iPod)

You can also use:


Inspecting Mobile_Detect.php will also reveal some other useful tools.

Do you have any examples?

Yup. This first example disables the sidebar for mobile/phone devices:

if (!is_mobile()) {

This second example loads a specific stylesheet for Apple devices (iPhone, iPod and iPad):

if (is_ios()) {
    wp_enqueue_style('ios', get_template_directory_uri() . '/ios.css');

Please note that in certain setups caching will cause undesired behaviour. If your cache is set too aggressively PHP will be skipped and the device detection will not work.


Does the job!

This plugin can be very useful, I used it to implement a “View desktop version” so thanks for your work! 🙂

Thank you!

hey scott, just wanted to drop by and to say thank you! for the time and effort that went into creating and maintaining this plugin.

I use it in any project and it made my life a lot easier

Great plugin

Plugin is very simple and works very well. Great example of the plugin that does one job and does it well. Very appreciated!

Great plugin but not compatible for cache plugin.

I installed this plugin to serve mobile banners on a responsive design site. It works well but it is not compatible with cache plugins (I’m using WP Super Cache). The cache plugin generate only one version of the page and once generated it is served both on desktop and on mobile site.
I had to disable cache for mobile pages to solve this problem but I’d like to serve cached pages also on mobile devices :((

Does it exist any hope this will be fixed by you or by SuperCache developer team?
It should be enough to have two version of a page: desktop and mobile (based on a user-agent list).

Please fix it :))

Read all 41 reviews

Contributors & Developers

“mobble” is open source software. The following people have contributed to this plugin.


“mobble” has been translated into 2 locales. Thank you to the translators for their contributions.

Translate “mobble” into your language.

Interested in development?

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



  • Mobile Detect 2.8.24
  • Add edge body class (props Luca Speranza)
  • Add filters to functions (props Matthew Keasling)


  • Add German translation (props @rpkoller)
  • Minor PHP improvements
  • Mobile Detect 2.8.17


  • Run through PHP tidy
  • Mobile detect update to 2.8.13


  • Update mobile detect library to 2.7.6
  • Small CSS change for 3.8


  • Small bug fix on is_mobile()
  • Moved screenshots out of trunk


  • Now uses mobile-detect ( which provides more accurate and varied detection
  • Mobiles can now be graded (A,B,C) using the mobile-detect API (see mobile-detect.php) or
  • is_palm, is_lg, is_nokia will be removed soon – check depricated notices
  • New check for is_kindle – feedback on this one appreciated as I cannot test it


  • Correction to the PHP.
  • New body class of .desktop for anything not handheld
  • Tested on 3.2+


  • Initial release.