• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

block editor

Workaround to WordPress Custom HTML block error

March 21, 2022 by Webhead

Problem

Sometimes you just want to write part of an HTML code block to maybe wrap the next block in. Or some small part of HTML that may not make sense to the editor. It doesn’t matter though. The block editor will throw an error like “This block contains unexpected or invalid content”. Irritating.

Solution

One solution is to create a simple shortcode and return the html you want to write out. Shortcodes let you return whatever HTML you want and the block editor won’t know about it.

Filed Under: Coding Tagged With: block editor, wordpress

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools