WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Disable javascript on widgets (4 posts)

  1. seanbee
    Member
    Posted 11 months 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 11 months 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 11 months 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.

Reply

You must log in to post.

About this Topic

Tags