Thread Starter
aegirr
(@aegirr)
Thank you for your answer. I have to examples here.
Example 1
I copy the code from a YouTube webpage, not the URL, but the code for publishing the YouTube-video on my website. When I use Custom HTML block to paste the code into I get just this black box with a link to YouTube on it. When I click on this box I am not able to edit the content of the Custom HTML block because the view of the content (the HTML code) of the block does not appear on the right side in WordPress. In other words, nothing happens when I click on the block itself. No edit is possible, unless i use the Code editor in WordPress.
Example 2
I use the Custom HTML block to publish text with several hyperlinks on it so that visitors can click on it to go to other parts (URLs) of my site. When I click on the text in order to edit the content of the Custom HTML block I am not able to edit it because I do not get the edit-box for the block on the right. When I click on the text I am just transfered to the webpages that represents the link under the text.
In both cases it is not possible to edit the content of the Custom HTML block.
The Custom HTML block has been very useful for me in order to have more control over the conent of my web site, but now it is a nightmare to work with
By the way, I think it was a mistake to add CSS and Javascript into the Custom HTML block, it just makes things more complex and less userfriendly. Why fix something that actually works?
-
This reply was modified 1 week, 4 days ago by
aegirr.
@aegirr I’m wondering you’re using custom HTML block for Youtube instead oEmbed? What is the reason for that? You have to add some special attributes or markup?
I really recommend to avoid custom html whenever possible. When your site it growing, its very hard to handle it. If oEmbend not work for your usecase, you can still create a custom shortcode, then you can update/change the youtube code on one place instead everywhere on your site.
hi @aegirr
I’ve noticed the same issue with the Custom HTML block after the recent WordPress update.
For now, I’ve been using the Code Editor when I need to edit HTML. For things like YouTube videos, I prefer using the built-in YouTube/Embed block instead of adding iframe code manually.
For larger or reusable HTML, I usually move it into a shortcode or custom block. These are good alternatives until the Custom HTML block issue is fixed.
Hi @aegirr,
WordPress 7.1 changed the Custom HTML block. You no longer edit the code in the sidebar. Once the block is selected, there’s an Edit code button in the block toolbar and in the block’s Settings sidebar. It opens an “Edit HTML” window with HTML, CSS and JavaScript tabs; click Update to save.
The catch is that the block now shows your HTML live in the editor, so clicking on it hits the video or the link instead of selecting the block. To select it without clicking the content:
- Open List View (the three-lines icon in the top toolbar, or Shift+Alt+O; Ctrl+Option+O on Mac).
- Click the Custom HTML block in the list.
- Click Edit code.
For YouTube, pasting the video URL on its own line creates an Embed block, which avoids the problem entirely. If clicking a link actually takes you out of the editor, that looks like a bug worth reporting on Gutenberg GitHub with these steps.