wp-includes » Uncaught Error: Call to undefined function wp() in wp-blog-header.php:16

Uncaught Error: Call to undefined function wp() in wp-blog-header.php:16

[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:

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.

image 5 1024x397 - Uncaught Error: Call to undefined function wp() in wp-blog-header.php:16
empty wp-config.php file

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?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended