• Resolved Peter Wooster

    (@pkwooster)


    One of my clients got this Fatal error.

    Cannot declare class WP_Widget_Block, because the name is already in use in … /wp-includes/widgets/class-wp-widget-block.php on line 0

    The cause was an old Gutenberg plugin that was included on her site. I removed the plugin and that fixed the site.

    This was WordPress 5.8 and Gutenberg 6.7.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator James Huff

    (@macmanx)

    The Block Editor has been built into WordPress since version 5.0.

    Since then, the Gutenberg plugin is just a testing ground for upcoming features and not guaranteed to be stable.

    If you do not need those upcoming features now, I recommend not using the Gutenberg plugin.

    Thread Starter Peter Wooster

    (@pkwooster)

    Thank you for the clarification. It seems that WordPress tolerated the old plugin until version 5.8 (new widget support?). I took a look at her plugins from SFTP and immediately removed Gutenberg as I knew it was no longer needed.

    This post is for all the people who keep posting questions about this specific error and getting the usual “disable all plugins” answer. That’s hard to do if you don’t have access to the admin. Deletion using FTP or equivalent is all you can do.

    I’m sure you have clients who never maintain their plugins but let their host update WordPress. I’m surprised that the host didn’t back off the update as this error breaks everything, including the admin.

    • This reply was modified 3 years, 3 months ago by Peter Wooster.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cannot declare class WP_Widget_Block’ is closed to new replies.