Warning: call_user_func_array() expects parameter 1

When you get this type of error on WordPress, there’s a huge percentage of probability that your theme is broken.  You normally get this type of error because a function on the functions.php for your theme is missing but there’s still the call for that function.

For example, let’s say you wanted to delete a function you’re not going to use anymore that is currently declared on your theme:

function my_function () {}

Normally you would delete or comment out the function declaration for my_function.  But if, for any reason, you forget to delete the add_action call, then you’re going to start seeing errors related to the call_user_func_array() on wordpress.

This normally happens when you have an add_action for that function in a different part of the code and you forget about it when deleting your function.

This error is very difficult to detect and solve as it doesn’t show which function is missing and where is the wrong add_action on the code.

To solve it, just comment one by one all the add_action calls that you suspect are causing the error, until you see the error go away.   Then you will know which deleted function was causing the problem.

PD: This error could be also related to plugins authors that declared a function on a previous version of their plugin and then on a newest version they delete it but forget to delete the action related.


9 thoughts on “Warning: call_user_func_array() expects parameter 1

  1. How about you just delete the last plug in that caused the situation. It’s what worked for me after three hours of trying to follow vague instructions on WordPress forums.

  2. This has to be the worst error message designed in human history. Even if you figure out what it means… it still doesn’t tell you the name of the function that is missing.

  3. Hey, just wanted to let you know this really helped me solve an issue with a plugin I wrote. For some reason just one particular server didn’t like my plugin being initialized through the “plugins_loaded” hook. It was also causing random memory leaks, not sure why but changing it to the “init” hook solved the problem.

Leave a Reply