Catchable fatal error in formatting.php

I'm running a WordPress 4.4.2. I have one site that's working fine. When I went to set up another site, I got the following error upon trying to save the "general" settings page:

Catchable fatal error: Object of class WP_Error could not be converted to string in /{site-url}/wp-includes/formatting.php on line 1025'

Before saving the settings, I deleted the existing sample page and sample post and created a new page. Didn't touch anything else.

After researching the problem, I have done all of the following:

  • Deactivated all plugins (error persists)
  • Changed to default WordPress theme (error persists)
  • Reinstalled current WordPress version (error persists)
  • Upgraded the network (error persists)
  • Checked Options tables in phpMyAdmin, no fishy strings exist
  • Compared Options table between the site with and without the error, they seem identical
  • Run the WP-Optimize plugin

I notice that I can only save values to the Options table from phpMyAdmin. When I try via the browser (ex. wp-admin/network/site-settings.php?id=#), the options don't save.

When I set an additional site to test, I don't have this problem. Obviously, I can just delete the site and start over, but a) the problem exists also on my default multisite, and b) I'd like to understand what's causing it.

Is this a bug? Am I missing something obvious?

Topic errors database Wordpress

Category Web


You havent included all lines of the error page. Only that line is not enough. As a quick solution, you can insert in wp-includes\formatting.php 1025 line:

var_dump($string); 
var_dump(debug_backtrace());
exit;

and see what you get.


I had the same issue and I cleaned the content of the row called theme_mods_YOURTHEMENAME (into the table wp-options)

I copy/past the content I had with a previous backup.

Now it works well.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.