WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Disable javascript on widgets (4 posts)

  1. seanbee
    Member
    Posted 1 year ago #

    I recently installed a wp multisite, i want to know if it is possible to disable users from adding javascript snippets such as adsense or any other in to widgets from their user areas?

    Similar to wordpress.com

  2. catacaustic
    Member
    Posted 1 year ago #

    I don't know of any direct ways to do it, but that's only after a very quick search so there might be something hidden deep down in the source code that I've missed.

    If I had to do this, I'd do it by wrapping the calls to get_sidebar() in a call to strip_tags() and passing in the allowed tags like p, li, ul, etc. It's a bit of a hacky work-around, but it's able to be done that way.

  3. By default, no one but the super admin can insert iframes or embed or (I THOUGHT) JS.

  4. seanbee
    Member
    Posted 1 year ago #

    By default, no one but the super admin can insert iframes or embed or (I THOUGHT) JS.

    Yes that is the case it seems. Thank You.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags