Support » Fixing WordPress » Uncaught Error: Object of class WP_Error could not be converted to string

  • Charles

    (@charlesrodmell)


    [Mon Nov 01 11:49:50.247045 2021] [proxy_fcgi:error] [client redacted] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /home/storm/sites/sitename/public/wp-includes/formatting.php:1098\nStack trace:\n#0 /home/storm/sites/sitename/public/wp-includes/formatting.php(4478): wp_check_invalid_utf8()\n#1 /home/storm/sites/sitename/public/wp-admin/options-general.php(124): esc_html()\n#2 {main}\n thrown in /home/storm/sites/sitename/public/wp-includes/formatting.php on line 1098’, referer: https://sitename/wp-admin/plugins.php?plugin_status=all&paged=1&s

    The site has all plugins disabled and is using 2020 theme. I’ve tried pressing reinstall wordpress.

    Is this caused by an object in the database? How would I track it down?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator t-p

    (@t-p)

    What was done at the site before this problem? WP/plugins/theme update? Any changes/mods?

    Thread Starter Charles

    (@charlesrodmell)

    @t-p It has been like that for a long time as far as I’m aware. The previous dev is no longer available. It appears on the admin/settings/general page. There is no save button on the page and instead, I see the “critical error” message and found that warning in the PHP logs.

    I tried copying the whole site to staging and updating to the latest wordpress (and pressing reinstall wordpress too) and disabling ALL plugins and using 2020 theme.

    Moderator t-p

    (@t-p)

    I see the “critical error” message

    Errors like this are logged. Check the error log on your server. If you can’t find the log, please contact your host. Meantime, enable wp_debug and wp_debug_log and after an error, look at wp-content/debug.log to see if anything gets logged there. https://wordpress.org/support/article/debugging-in-wordpress/

    You can also try to disable plugin/theme:
    – Try manually resetting your plugins (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.
    – If that does not resolve the issue, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, navigate to /wp-content/themes/ and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue (theme functions can interfere like plugins).

    Also review https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-critical-error-in-wordpress/

    Thread Starter Charles

    (@charlesrodmell)

    Well yeah, that’s the info from the server error log in the first post, and as mentioned above, there aren’t any plugins to disable and the theme is the default theme.

    Am I correct in thinking that if you press “reinstall latest version” (of wordpress) on the updates page, it downloads the whole of wordpress and overwrites all the files, so it should be fresh? If not and it only downloads changed files, I’ll have to manually upload a new copy myself.

    But I think wordpress is trying to parse a database item, but I’m not sure how I would go about trying to locate which table / row it is trying to parse.

    Moderator t-p

    (@t-p)

    If you want to update WordPress, try MANUALLY updating. Please read the Manual Update directions first.

    BACKUP: If you haven’t already done, always backup everything (including your database) before doing any actions, just in case something really goes wrong. You can never have enough backups! See https://wordpress.org/support/article/wordpress-backups/

    Thread Starter Charles

    (@charlesrodmell)

    Is @t-p a robot answering service? It doesn’t seem to notice what I’ve written or answer my questions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Uncaught Error: Object of class WP_Error could not be converted to string’ is closed to new replies.