Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Detect Mobile

Lightweight PHP plugin for EE5 that detects a mobile browser using the PHP Mobile Detect class. Contains a bundled version of 2.8.33. For EE2 support see the EE2 tagged release.

To install simply copy the detect_mobile directory to system/user/addons and install the add-on via the Add-On manager.

Basic Usage

Check if any mobile device

Returns true or false for use in conditionals see later examples


Check if not a mobile device


Check if tablet


Check if phone


Conditional check for a mobile device

{if '{exp:detect_mobile:ismobile}'}
    I am a mobile device
    I am not a mobile device

Redirect any mobile device including tablets

{exp:detect_mobile:redirect location=""}

Redirect all non-tablet mobile devices

{exp:detect_mobile:redirect location="" tablet="no"}

Redirect just tablets and not mobiles

{exp:detect_mobile location="" mobile="no"}

Seperate redirect locations for tablets and mobiles

{exp:detect_mobile tablet_location="" location=""}

Check for device type


returns phone, tablet or none

Conditional check for device type

{if '{exp:detect_mobile:type}' == "tablet"}	
    I am a tablet
{if:elseif '{exp:detect_mobile:type}' == "phone"}	
    I am a mobile phone
    I am not a mobile device


Lightweight PHP plugin for EE2/EE5 that detects a mobile browser using the PHP Detect Mobile class




You can’t perform that action at this time.