Custom HTML block is not converting iframe into a shortcode

  • Unknown's avatar

    I always use the Custom HTML block to paste the <iframe></iframe> taken from Google Maps to embed a map in my post. The Custom HTML block used ot manually convert the iframe into a shortcode.

    Recently, I observed that there are some changes in the Custom HTML block, and it’s not converting the iframe into a shortcode. Because of this, I can’t embed a map in my post.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    The behavior you are observing is due to updates in the WordPress Block Editor, which now attempts to preserve raw HTML in the Custom HTML block rather than auto-converting it to legacy shortcodes; unfortunately, on many WordPress.com plans, raw <iframe> code is stripped out for security reasons upon saving, which is why your map is disappearing. To fix this on oneplusone3.in, the most reliable method is actually to stop using the Custom HTML block for this task entirely. Instead, simply copy the direct “Share” link (the standard URL, not the embed HTML) from Google Maps and paste it directly into an empty Paragraph block or use the dedicated YouTube/Embed block; WordPress will automatically recognize the link and convert it into a fully interactive map using its secure oEmbed feature. If you prefer the old shortcode method, you can still manually type [googlemaps url] into a Shortcode block, but pasting the direct link is the modern, future-proof standard.

  • Unknown's avatar

    Thanks for the response. I tried putting the share link directly in an empty Paragraph block as well as in the Embed block. No luck.

    The Embed block stays as it is, not getting converted into an interactive map. On saving and opening the post, I can see just the plain URL, not the map.

    Lastly tried the old shortcode way as well… [googlemaps url] but again no luck.

  • Unknown's avatar

    It sounds like the issue stems from the specific type of link being used; the standard “Share” link (often maps.app.goo.gl) or the main browser URL often fails to trigger the embed because WordPress can’t parse the necessary coordinates from them. To make the legacy shortcode work, you cannot use the standard page URL; instead, you must go back to the “Embed a map” tab on Google Maps, copy the HTML code, extract only the URL found inside the src=”…” quotation marks (which usually starts with https://www.google.com/maps/embed?…), and paste that specific link into the shortcode like [googlemaps https://your-embed-src-link%5D. However, the far easier and more stable solution on WordPress.com is to simply insert the native Map Block (by typing /map in the editor), where you can type the address directly into the block’s settings to generate an interactive map without needing any code, external links, or embedding tricks.

  • Unknown's avatar

    [googlemaps url] appraoch (where url is taken from ‘src=’ in “Embed a map” tab from Google Maps gives the following error.

    The /map component is primitive, sorry to say, but useless. I just want to put ‘Westin Doha’, and it can’t figure it out. Also, many times I provide a walking map to explore a neighbourhood. That is not possible with /map, it seems.

    Surprisingly, WordPress.com support is completely silent on this issue.

  • Hi there!

    I’ve sent you a follow-up email with more details on what’s happening here and a workaround you can use in the meantime. I’ve also flagged this as a bug with our team — the issue is how & characters in location names get encoded when the embed code is converted to a shortcode.

    Check your inbox and let me know if you have any questions!

  • Unknown's avatar

    Thank you very much for your response and analysis.

    1. Yes, it seems only Westin Doha has the issue while embedding, and as you said, probably due to the ‘&’. I can embed other places in my post.

    2. I will wait for the issue to get resolved so that I can move back to Custom HTML.

    3. Meanwhile, I will try to use the plug-in as recommended by you. Thanks for enabling it for me. Appreciate that.

    Thanks again for the help.

Log in or create an account to reply