• Resolved Karl

    (@krayfishkarl)


    Hi,

    I’ve recently encountered a major issue with editing pages/posts on WordPress. Whenever I try to save or publish a page that includes the iframe tag in a Custom HTML block, I get an error message that says “Updating failed. The response is not a valid JSON response.” However, removing the iframe tag will allow me to save it, even if there is other HTML code present.

    I’ve tried clearing the cache, temporarily disabling all plugins, temporarily disabling the firewall and even logged in on a different computer. All to the same effect. However, pages that had previous iframe embeds still work. I just can’t update them without removing the iframe tags.

    I only started noticing this today. I’ve had zero issues with this before, and I’m not sure why it is happening now.

    The steps to replicate:

    -Create a new page or edit an existing one.

    -Copy and paste an iframe embed (I was using embeds from Steam game pages, but I also replicated it on.

    -Attempt to save as a draft.

    -You will see the error message.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator threadi

    (@threadi)

    I can’t seem to reproduce that on my end. Could you please show me the exact code you’re using? And which editor are you using to enter the code?

    Note: If you’re using the Block Editor, paste the code into the HTML block. See: https://ww.wp.xz.cn/documentation/article/custom-html/

    Thread Starter Karl

    (@krayfishkarl)

    I’m using the Block Editor with Custom HTML exactly as shown in the link you posted. I get the error to appear with this sample code, but anything that uses the iframe tag seems to trigger it.

    The following code triggers the error:

    <iframe src="https://www.w3schools.com" title="W3Schools Free Online Web Tutorials">

    Another thing worth noting is that when hitting Preview in New Tab, if the Custom HTML block contains the iframe tag, the block completely disappears from the preview version of the page.

    Moderator threadi

    (@threadi)

    First of all, it would be a good idea to use the code block here in the forum so that your HTML code displays correctly. I suspect that the double quotes, which are currently displayed incorrectly here, actually look correct on your end. Like this:

    <iframe src="https://www.w3schools.com" title="W3Schools Free Online Web Tutorials"></iframe>

    I tested the issue you described in the Playground and couldn’t reproduce it there either. My guess would therefore be that either your user permissions aren’t set correctly, a plugin is interfering here (though you’ve already ruled that out yourself) or a serverside error.

    Are you logged in as an administrator for this project? An administrator always has full permissions to write HTML code. Users with other roles generally don’t have this permission. If you have a different role, contact your project’s administrator and ask them to grant you permission for this.

    It could also be an actual server-side error, for example caused by a security tool on the hosting server, although that would be highly unusual for HTML code containing iframes. You can verify this by checking your host’s error logs. Your host’s support team can help you locate them.

    Thread Starter Karl

    (@krayfishkarl)

    Okay, so it works in the Playground just fine. I’m the only editor on my site and I have admin permissions, so I’m going to guess that it’s a server side issue. Going to look into that a little further.

    Thread Starter Karl

    (@krayfishkarl)

    Update: So I discovered a workaround. Installing a plugin that goes back to the classic editor does get around the issue and iframe works correctly. At this point, I genuinely have no clue what’s going on. I might stick with it this way for the foreseeable future

    Thread Starter Karl

    (@krayfishkarl)

    Update: So after further investigation, it was a server-side error after all. It was a false positive on my firewall that was not letting the iframe tag go through.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.