[20-Feb-2023 11:21:11 Europe/Belgrade] PHP Fatal error: Uncaught Error: Call to undefined function wp() in /home/user/example.com/wp-blog-header.php:16
Stack trace:
#0 /home/user/example.com/index.php(17): require()
#1 {main}
thrown in /home/user/example.com/wp-blog-header.php on line 16
You may notice this error Uncaught Error: Call to undefined function wp() in wp-blog-header.php:16 on your error_log file if:
- A: wp-includes/functions.php file is corrupted;
- B: wp-config.php file is empty;
wp() is a WordPress core function that calls wp-includes/class-wp.php file from which all required variables are set for the WordPress environment.
In plain English: This is like the “boot” sequence on your computer, only for WordPress telling it what to load and in which order.
If the wp-config.php file is empty, then no variables can be set.

To fix the problem reinstall WordPress core and re-create the wp-confih.php file, or restore it from a backup.
Then analyze the root cause of the problem – in most cases, it’s either a rogue (malicious) plugin or human error.
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂

