Blog / Articles15 July 2025

How to Resolve «Fatal error: Uncaught Error: Call to undefined function» in WordPress

If you’re managing a WordPress site and suddenly encounter a white screen with a message like:
Fatal error: Uncaught Error: Call to undefined function ... in /wp-content/themes/your-theme/functions.php on line 23 – don’t panic. This is a common error and is usually straightforward to fix. In this article, we’ll break down what causes it, how to diagnose it, and how to resolve it step-by-step.
TL;DR: This error typically means WordPress is trying to call a function that doesn't exist, often due to a missing plugin, a typo, or incompatibility. To fix it, check the error line, confirm plugin/theme activation, validate PHP version, and look for missing includes or conflicts.
What Does This Error Mean?

What Does This Error Mean?

This particular error indicates that your WordPress code is trying to call a function that doesn’t exist at the moment it's being executed. PHP halts execution, and WordPress can't load.
"Uncaught Error: Call to undefined function" means the function you're trying to use either hasn't been declared yet, was removed, or is not available in your current context.

What Does This Error Mean?

Common Causes of the Error

1. Missing or Incorrectly Loaded Plugins or Themes

If your code depends on a plugin or theme that defines the function — and that plugin/theme is deactivated, deleted, or incorrectly loaded — the function won't exist when called.

2. Plugin Incompatibility

A newly installed plugin may not be compatible with your version of WordPress or PHP version set before.  If the plugin uses a function introduced in a newer version of PHP (e.g., str_contains() in PHP 8.0), older environments will throw a fatal error.

3. Faulty custom code

Function names in PHP are case-insensitive, but a typo can lead to an undefined call. For example:


add_action('init', 'custm_function'); // Typo here: ‘custm_function’ -> ‘custom_function’

4. Corrupted WordPress Core Files

If your WordPress installation is corrupted or incomplete, some native functions may be missing. When core files (like wp-includes/functions.php) are damaged or missing, native WordPress functions may become inaccessible, even though they normally exist.

5. Some extensions are disabled by default on the server

The absence or disabling of required PHP extensions on the server, in particular mbstring. This extension is necessary for working with multibyte strings, which is critical for the correct processing of text data in many WordPress plugins and themes. The PHP function mb_strlen() is part of the mbstring extension. If it is not installed or activated on the server, any call to the corresponding functions will result in a fatal error with the message “Call to undefined function”. This error usually occurs after migrating a site to a new hosting provider, when changing the PHP version without re-enabling extensions, and when installing a plugin or theme that depends on mbstring.

6. Disabled functions for security reasons

Sometimes the error occurs when the code tries to call a function that is not in the runtime environment. Often the reason is that this function is intentionally disabled in the php.ini configuration file for security reasons. For example, functions like exec(), shell_exec(), passthru() or system() are often blocked on shared hosting.

Still Seeing the Error? Let Us Help

We’ve fixed hundreds of WordPress errors just like this one for clients across the globe. Whether your site is broken after a plugin update or you’re dealing with a custom theme gone rogue, we can diagnose and fix the problem quickly and safely.

How to Fix This Error: Step-by-Step

1. Don’t forget to back up!

Before doing any debugging or modifications, back up your entire WordPress site (files + database). This ensures you can roll back if something goes wrong during troubleshooting.

2. Read The Error Message Carefully

Look at the file and line number where the error occurs. It’ll tell you where to start investigating:
Fatal error: Uncaught Error: Call to undefined function my_custom_function() in /wp-content/themes/your-theme/functions.php:45
Go to the file and line number indicated. Double-check that the function is spelled correctly and is declared.

Read The Error Message Carefully

3. Temporarily Disable Plugins to Check for Conflicts

Often the error occurs after installing or updating plugins. To check for conflicts, sequentially disable installed plugins. You can do this either through the admin panel, if you have access to it, or on the hosting through the file manager, or FTP. To do this, go to the plugins folder and sequentially rename the installed plugins. To do this, for example, add the prefix “old” to the plugin name, or any other you wish.

Temporarily Disable Plugins to Check for Conflicts

4. Repair or Reinstall WordPress Core Files

If you suspect corrupted WordPress core files, re-download WordPress and re-upload everything except wp-content and wp-config.php. Or use the built-in repair option in the WordPress dashboard.

Repair or Reinstall WordPress Core Files

5. Check PHP Version and Extensions

Make sure your hosting environment meets the requirements. Some functions require specific PHP versions. Confirm you're running a compatible version:

    • Log in to your hosting dashboard or use phpinfo();
    • Upgrade to PHP 8.0+ if needed;
    • Make sure that the necessary extensions (e.g., mbstring) are enabled. Create a phpinfo.php file with the following content:
      
      <?php phpinfo(); ?>
      
      
      and open it in your browser. Check for the mbstring section. Enabling the extension If you have access to the server configuration (e.g., via php.ini or the control panel), make sure that the line:
      
      extension=mbstring
      
      
      is not commented out. If you do not have administrative access, contact your hosting support service and ask them to enable the mbstring PHP extension.

6. Check the list of disabled functions

To check the list of disabled functions in your PHP environment, create a file info.php with the following content


<?php phpinfo(); ?>

Upload it to your server and open it in a browser. Find the disable_functions section - it contains a list of all disabled functions.

Conclusion

The "Call to undefined function" error in WordPress can seem intimidating at first, but it’s usually a straightforward fix once you understand what’s causing it. Always start by reading the error message, checking that the function is defined and loaded properly, and using the correct WordPress and PHP versions. If the error turns out to be more complex than the fixes outlined here, it's best to consult our experienced WordPress specialists to resolve it safely and efficiently.

Artem Okhrei
Arto Web Agency Co-founder, Web-developer
I have been working in the field of online business since 2012. I strongly believe that any details matter. And it is important to take into account every of them to achieve success in this area. I regularly share my experience at different seminars. If you have any questions about this article, please write me to artem@arto.agency.

Be first to know about important!

How-to articles, news and reviews. We write to you when we really have something to say
COMMENTS
LEAVE A COMMENT
LOGIN
  • Facebook
  • Twitter
THIS SITE USES COOKIES
We use cookies to analyze traffic, provide social networks features, and for functions of the commenting system on the site. The list of cookies to be set is located on this page. Do you agree to accept cookies?