• Hi, I’ve searched for a reason why my style attributes disappears from the content of a page when I hit save in wp-admin, but found nothing. It seems that this only occurs when a non-administrator user is logged in.

    I find this very strange since I removed the visual tab for pages to be able to preserve divs that has background images and such.

    Does anyone know what might cause this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Double-check that you’re using valid HTML markup. If that isn’t the issue try deactivating all of your plugins to explore whether any could be responsible. If none are, keep all plugins deactivated and switch to the Twenty Fifteen/ Fourteen theme to see whether it could an issue with your theme.

    Solved!

    I had the same problem, and realised that it was due to the unfiltered_html permission being available to admins and editors, but not contributors.

    The permission is https://codex.wordpress.org/Roles_and_Capabilities#unfiltered_html

    I have close control over my contributors, so I actually gave them that single permission and it fixed the issue. I’m sure there are many many ways of enabling that permission, but I did it with the “WPFront User Role Editor” plugin which I already had installed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Style attributes being removed on save’ is closed to new replies.