Description
Mobily serves a different theme to mobile visitors while desktop visitors keep your active theme. Pick a theme for each device class – or leave it at “Same as desktop”.
Features
- Theme per device: iPhone & iPod touch, iPad, Android phones, Android tablets and all other mobile devices (Kindle, Opera Mini, BlackBerry, …).
- Classic and block themes are supported. Every theme keeps its own menus, widgets, Customizer settings and global styles.
- Visitor switch: visitors can change between the mobile and the desktop version. Their choice is remembered in a cookie (lifetime configurable).
- Block “Theme Switch Link” for posts, pages and block theme templates, plus the classic shortcode
[wp_mobily_shorter]. - Preview each device theme as an administrator without affecting visitors.
- Cache-safe: optional
Vary: User-Agent, Cookieheader; pages shown because of a visitor choice are never cached. - Safe by design: the admin area, REST API, AJAX, cron, the login page and the Customizer always use the desktop theme.
- Abilities API: read-only ability
wp-mobily/get-theme-for-user-agenttells AI assistants, MCP clients and scripts which theme a user agent gets (requires theswitch_themescapability). - Modern code base for PHP 8.3+ – lightweight, no external requests, no tracking, no ads.
Switch links
?mobily_wp_theme_layout=mobile– show the mobile theme?mobily_wp_theme_layout=desktop– show the desktop theme?mobily_wp_theme_layout=auto– forget the choice and detect the device again
The values mobily and orginal of older versions still work.
For developers
- Filter
mobily_detected_device– change the detected device (iphone,ipad,android,android_tablet,mobileor empty for desktop). - Filter
mobily_target_theme– change the stylesheet served to the current visitor. -
Ability
wp-mobily/get-theme-for-user-agent– inputuser_agent(and optionallayout:auto,mobile,desktop), outputdevice,device_label,theme_slug,theme_name,is_mobile_theme:wp_get_ability( ‘wp-mobily/get-theme-for-user-agent’ )->execute( array( ‘user_agent’ => $ua ) );
Privacy
Mobily does not store personal data, does not contact external services and does not track visitors. If a visitor uses the switch link, a functional cookie (mobily_wp_theme_layout) remembers the choice. A suggested text for your privacy policy is added under Settings › Privacy.
ബ്ലോക്കുകൾ
ഈ പ്ലഗിൻ 1 ബ്ലോക്ക് നൽകുന്നു.
- Theme Switch Link Mobily: lets visitors switch between the mobile and the desktop theme. Only shown where a switch is possible.
Installation
- Install the plugin through Plugins › Add New or upload the folder
wp-mobilyto/wp-content/plugins/. - Activate the plugin.
- Install the theme(s) you want to use on mobile devices (they do not need to be activated).
- Go to Settings › Mobily and choose a theme for each device class.
- Optional: add the block “Theme Switch Link” or the shortcode
[wp_mobily_shorter]so visitors can switch.
FAQ
-
Does it work with page caching?
-
Page-cache plugins store one copy of a page and serve it to everybody. Enable their mobile option (for example “separate cache for mobile devices” or “do not cache for mobile user agents”) so phones and desktops get different copies. For proxies and CDNs enable “Send the Vary header” in the Mobily settings (sends
Vary: User-Agent, Cookie). Pages that are shown because of a visitor’s switch choice or an administrator preview are always sent withCache-Control: private, no-store,Vary: Cookieand theDONOTCACHEPAGEconstant, so they are never stored in shared caches. -
My iPad shows the desktop theme. Why?
-
Since iPadOS 13, Safari requests the desktop website by default and identifies itself as a Mac. A server cannot tell it apart from a desktop computer. Visitors can still use the switch link.
-
Use the preview link on the settings page to open the mobile theme. Menus, widgets and Customizer settings are stored per theme, so you can configure them while the mobile theme is active on a staging site, or with the Site Editor for block themes.
-
Only when a visitor uses the switch link. The functional cookie
mobily_wp_theme_layoutcontainsmobileordesktopand nothing else. -
Which PHP and WordPress versions are required?
-
Mobily 5 requires PHP 8.3 or newer (tested with PHP 8.3, 8.4 and 8.5) and WordPress 7.0 or newer. If your site runs an older version, WordPress keeps offering you version 4.0 – ask your host for a PHP update first.
-
I updated from version 4.x or older. Do I have to configure everything again?
-
No. Your device themes, link texts and the “show on desktop” option are migrated automatically on the first page load after the update. Please check Settings › Mobily once.
Reviews
ഈ പ്ലഗിന് റിവ്യൂകൾ ഒന്നുമില്ല.
Contributors & Developers
“Mobily – Mobile Theme Switcher” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Mobily – Mobile Theme Switcher” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
5.0.0
- Renamed from WP-Mobily to Mobily – Mobile Theme Switcher (slug, shortcode, links and settings stay the same).
- Complete rewrite for WordPress 7.0+ and PHP 8.3+ (tested with PHP 8.3, 8.4, 8.5 and WordPress 7.1): strict types, enums, readonly value objects, own autoloader.
- New: Abilities API integration – read-only ability “Get theme for a user agent”.
- New: “Other mobile devices” class, Android tablets and phones handled separately.
- New: block “Theme Switch Link”, shortcode attributes
mobile_text,desktop_text,class. - New: administrator preview per device, configurable cookie lifetime, optional
Varyheader, reset link (?mobily_wp_theme_layout=auto). - New: settings page with a modern card layout.
- New: each mobile theme uses its own theme mods, menus and widgets.
- Fixed: switch links of older versions did not work reliably (
mobilevs.mobily), link texts could not be saved, PHP 8 warnings. - Fixed: the mobile theme was also loaded in the admin area, REST API and AJAX requests.
- Security: all input is validated against whitelists, all output is escaped, the cookie is
HttpOnly,SameSite=LaxandSecureon HTTPS. - Security: responses that depend on the visitor’s choice or a preview are marked as private/no-store and excluded from page caches (prevents cache poisoning).
- Removed deprecated WordPress functions (
get_themes,get_current_theme).
4.0
- Tested with WordPress 5.6.
3.1
- Tested with WordPress 4.9.4.
2.0
- Fixed a query bug, tested with WordPress 4.4.
1.0
- First release.

