The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Email Subscription

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 717 other subscribers

Cleaning <!– wp:* comment elements from the WordPress Gutenberg editor

Posted by jpluimers on 2026/11/05

The only reason the very keyboard unfriendly WordPress Gutenberg editor can be a block editor is that it inserts tons of HTML comment elements starting with <!-- wp: in the code like for instance <!-- wp:paragraph -->…<!-- /wp:paragraph -->.

That makes the HTML even heavier than it already is, and getting rid of it wasn’t easy to find but is easy to do.

I wanted a JavaScript based solution, but could not find any quickly enough so for now these website based solutions work OK-ish when enabling the “clean comments” checkbox and then perform a clean action:

More links:

WordPress users seem madly in love with PHP, but that is really hard to implement client side and impossible server side unless your WordPress.com account is really expensive. In the above list, JavaScript solutions that are far easier to run client-side are regrettably absent and even the below queries didn’t find them.

Oh, finding back these Gutenberg posts on my blog was easy: https://wiert.me/wp-admin/edit.php?s=wp:paragraph

Queries:

--jeroen

Leave a Comment