Style elements being removed while editing

  • Unknown's avatar

    Hello – I used to be able to save an image with style elements that would put a shadow underneath it. It’s very simple style. It used to work, until maybe 6 mos. ago, now those style elements are removed when I save my blog post. What happened and will those ever be coming back?

    Thank you.

    WP.com: Yes
    Jetpack: No
    Correct account: Yes

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

  • Hello,

    I have tagged the team to help us.
    I managed to simulate the error you described, but I don’t know how to solve it.

    In the image block, I edited the HTML by inserting the Box Shadow property, and on the edit page, the shadow works perfectly. However, when publishing the post, the shadow disappears. When we go back to editing the HTML, you can see that the Box Shadow property is no longer there.
    I believe it is a Box Shadow property issue.

    I used this code:(The same one you used in your pictures)
    <figure class="wp-block-image size-large">
      <img src="" alt="" class="wp-image-229" style="width:305px;box-shadow:5px 5px 5px #999;">
    </figure>
  • @julinedossantos1 props for the solid work testing that. o/

    Hi @sdebeaubien we’ve had reports from other site owners with inline CSS issues and our dev team is investigating. For the time being I do not have a workaround you can employ other than to upgrade to our premium plan, which includes the ability to make stylesheet changes. This is preferable (and less effort) since code needs to be added only once instead of over and over as you need to do with inline code.

    If cost is an issue, you can also add CSS as an add-on here at much lower cost: https://wordpress.com/add-ons/

    We are also happy to update you here as soon as we know more about why inline code is not working. Thanks for your patience!

  • Unknown's avatar

    Thanks for investigating. I don’t have an “Exact” timeline. I can investigate my posts and see when the last one was posted that the inline style elements didn’t get removed. My post from Oct. 11, last year (2022) didn’t have those style elements removed. But after that, by Dec. 8, 2022, they get removed. Somewhere in there is where the change was made to the “Classic Editor” save mechanism that edits out inline style elements in img elements.

  • The topic ‘Style elements being removed while editing’ is closed to new replies.