Have you updated WordPress to the latest version 4.1 and unable to login to wp-admin? Well, you are not alone, as there are plenty out there facing this issue after upgrading their WordPress site. According to the posts in WordPress forum, few users were presented with a blank white screen when they logged-in to wp-admin and few were able to login, but greeted with an error – “PHP Fatal error: Call to undefined function wp_json_encode()“. I tried to dig through my httpd error log and found the same.
Why did this error occur first of all?
To be frank, I’m not sure or not able to guess the exact reason for this error. But all I can ask you is, did you update your plugins before upgrading the WordPress? After googling for few minutes, I understood that many users have updated their plugins before updating the WordPress to 4.1. That’s what I have learned from forum posts and in fact, I did update my plugins before updating the WordPress. So, probably this might be one of the reason for wp_json_encode() error.
How to fix Call to undefined function wp_json_encode() WordPress error?
- Just login to your server or hosting panel.
- Download the fresh copy of your WordPress 4.1 and unzip it.
- Upload the file functions.php located under wp-includes (of WordPress 4.1) folder to your WordPress installation directory in your hosting/server.
- Now try accessing wp-admin and boom, you should see the WordPress dashboard.
But I still see “WordPress 4.1 is available! Please update now.” in my dashboard? – Actually your WordPress has been updated, but you will continue to see the above message and visiting wp-admin/upgrade.php will say “No Update Required – Your WordPress database is already up-to-date! Never mind, at least you are able to see the dashboard after hitting with an annoying fatal error isn’t? Happy Blogging.
Did this post help you? or you have a better solution? Please share it with us in the comment section below.