If you are running a WordPress website then it tends to throw an error once in a while after a WordPress update. one of them is (Undefined Function Wp_is_mobile()). This happens after the WordPress update is not compatible with an outdated theme or plugin. happened to me and it was a nightmare even after trying several troubleshooting methods. After visiting several forums I found the solution to the issue or at least it worked for me…

  1. Try to manually update your wordpress files by uploading your wp-admin and wp-includes folder. DO NOT TOUCH the wp-content folder. follow this guide to know more. Click here.
  2. edit your wp-config.php file under /wp-content folder and edit set the debug mode to “true”. This will help you display the exact error you are getting. follow this guide to learn how to do that. Click Here
  3. after doing the above process and still, get the error “Undefined Function Wp_is_mobile()”, then follow the next step.

In your default theme folder under /wp-content/themes/ folder you will have a file named “functions.php”, edit the file and add the following code snippet at the end of the functions.php file.

function wp_is_mobile() {

static $is_mobile;

if ( isset($is_mobile) )

return $is_mobile;

if ( empty($_SERVER[‘HTTP_USER_AGENT’]) ) {
$is_mobile = false;
} elseif ( strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Mobile’) !== false // many mobile devices (all iPhone, iPad, etc.)
|| strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Android’) !== false
|| strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Silk/’) !== false
|| strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Kindle’) !== false
|| strpos($_SERVER[‘HTTP_USER_AGENT’], ‘BlackBerry’) !== false
|| strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera Mini’) !== false ) {
$is_mobile = true;
} else {
$is_mobile = false;
}

return $is_mobile;
}

This worked for me as the error stopped showing and i was able to successfully login into my WordPress site.