[Fixed Error] Call to undefined function wp() in wp-blog-header.php

O error which appeared to me on several blogs WordPress after they were moved from one server to another and had edited the file wp-config.php. "Call to undefined function wp() in wp-blog-header.php".

Due to error: – It seems that the file wp-config.php it loses its lines after being edited. Specifically, all the php code appears on a single line. I don't know what the exact cause is. Probably a php file editor issue.

[Fixed Error] Call to undefined function wp() in wp-blog-header.php

Solution: Copy & Replace to a new file wp-config.php in which to set your database, user database, pass and prefix.

// ** MySQL settings - You can get this info from your web host ** // 
/** The name of the database for WordPress */ 
define('DB_NAME', 'putyourdbnamehere');

/** MySQL database username */ 
define('DB_USER', 'usernamehere');

/** MySQL database password */ 
define('DB_PASSWORD', 'yourpasswordhere');

/** MySQL hostname */ 
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */ 
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */ 
define('DB_COLLATE', '');

define('AUTH_KEY', 'put your unique phrase here'); 
define('SECURE_AUTH_KEY', 'put your unique phrase here'); 
define('LOGGED_IN_KEY', 'put your unique phrase here'); 
define('NONCE_KEY', 'put your unique phrase here'); 
$table_prefix  = 'wp_';

define ('WPLANG', '');

/* That's all, stop editing! Happy blogging. */

/** WordPress absolute path to the WordPress directory. */ 
if ( !defined('ABSPATH') ) 
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */ 
require_once(ABSPATH . 'wp-settings.php'); 

The error disappeared after this update in the file wp-config.php al WordPress.

How to » WordPress » [Fixed Error] Call to undefined function wp() in wp-blog-header.php

Passionate about technology, I like to test and write tutorials about operating systems macOS, Linux, Windows, about WordPress, WooCommerce and configure LEMP web servers (Linux, NGINX, MySQL and PHP). I write on StealthSettings.com since 2006, and a few years later I started writing on iHowTo.Tips tutorials and news about devices in the ecosystem Apple: iPhone, iPad, Apple Watch, HomePod, iMac, MacBook, AirPods and accessories.

Leave a Comment