Support

Account

Home Forums Bug Reports Script tags stripped from Text Area for Admin user

Solved

Script tags stripped from Text Area for Admin user

  • Hi there!

    This took me a little while to finally reproduce consistently. What’s going on is I have a place in my theme to add in Google Tag Manager embed code using an ACF Text Area field type. On a simple WordPress install this works exactly as expected. Admins are able to edit this and it retains the embed as is.

    However, if the site is a multi-site install (mine is setup as a subdomain install), then users with the role of Admin have the script tags stripped when they save the Options page. It does work as expected if the user is a Super Admin though.

    Has anyone else come across this? I’m aware I could use a plugin to add in GTM code (or other embed code), but I’m looking for a solution to script tags not being removed from Text Areas when you have a role of Admin in a multi-site install.

    Thanks!

  • Yes.

    I started with this. I can’t say if I’ve made modifications to it or not, I may have had to in order to get it working but I can’t really remember https://wordpress.org/plugins/unfiltered-mu/

  • Thanks for the quick reply. Sorry that I thought it was a bug when it instead seams to be standard functionality in WordPress multi-sites to behave this way for security reasons.

    Thanks again!

  • Yes it is, and it is a PITA. The only multisites I have only trusted people are given admin access. It’s not like I run any sites where anyone can just create a site. This is something I have to dig into every time I set one up. It will block a lot more than just scripts as well. Any attribute that’s not recognized will also be stripped.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.