I have two themes, one for mobile and other for desktop. I have created 2 user agent rules for Mobile and iPad. All mobiles are showing mobile theme. But iPad and Tablets are also showing mobile theme. I need iPad and Tablets to show desktop theme. Can anyone please help me to fix this issue?

enter image description here

1 Answer 1


This is because the mobile user agent includes the iPad. To workaround this you'll need to specify the mobiles individually.

Note that the Safari on iPad user agent string contains the word "Mobile", but does not contain the word "iPhone". If you are currently serving mobile content to any browser that self-identifies as "Mobile", you should modify your user agent string checks to look for iPad and avoid sending it the wrong version of your site.

For example:

Mobile theme

iPhone|iPod|BlackBerry|BB10|Pre|Palm|Googlebot-Mobile|mobi|Safari Mobile|Windows Mobile|Android|Opera Mini|mobile

Desktop theme

iPad|Silk|Kindle|Xoom|SCH-I800|GT-P5210|Android Tablet|Tablet|SM-T520|hudl|HT7S3|ME173X|JSS15Q|Nexus 7|Nexus 8|Nexus 9|Nexus 10

If that doesn't work try also removing mobi. That list is a few years old now so you may need to add some more if you find new devices aren't working as you'd expect.

Some info taken from this M1 answer

  • Hello @Ben Crook, I want solution for Magento 2..
    – Hima Mohan
    Commented Jul 5, 2017 at 13:04
  • the design exceptions haven't changed much, my answer applies to both.
    – Ben Crook
    Commented Jul 5, 2017 at 13:08
  • Doesn't work for magento 2.3.5:(
    – chdzma
    Commented Jun 23, 2020 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.