Support » Fixing WordPress » Stripping SRC from SCRIPT tags

  • I’m trying to include a flash file via javascript. This would work fine (tried and tested) except that WordPress is stripping the SRC from my SCRIPT tags. What’s going on?

    Here is my code:
    <script language=”javascript” src=”″></script>

    And WordPress turns it into:
    <script language=”javascript” />

    I installed the Text Control plugin but it lacks any directions on what all the weird modes mean, and after trying a few of them, see no change to the stripping of the src=”” part. Help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • See if this helps: Using_Javascript.

    Thanks for the reply, but that page doesnt help. Those any many other sites on using javascript in WordPress say the way to do it is to include something like the following:

    <script type=”text/javascript” src=”/scripts/emailpage.js”></script>

    When that is precisely my problem – the src=”/scripts/emailpage.js” is being stripped out.

    It’s best to enter the code manually in the basic editor – do not c & p from anything but Notepad or similar.

    I was copying it from a text editor. I’ve also tried manually inputting it. In either case, the src gets stripped out.

    I think it might be TinyMCE (the javascript interface used by WordPress for all entries) that might be stripping the tag but I’m not sure.

    Does it work when you disable the Text Control plugin or when you turn off the rich text editor?

    I got the TextControl plugin to try to get it to work. So it’s stipped out with or without it.

    How do I turn off the rich text editor?


    Does anybody know how to turn off the rich text editor?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Go to the Users page and turn it off at the bottom of the screen.

    Or just click the HTML button in the editor to be able to directly edit the text without the editor’s help.

    Whoohoo! I was getting very frustrated with this exact problem. Followed CODEX instructionas Using_Javascript and my src was getting stripped in addition to my line endings getting lost, even while using TextControl.

    I was entering the code in the text editor popup provided by the HTML link on the rich editor. As soon as I unchecked ‘Use the visual rich editor when writing’ in my user profile everything worked as expected.

    Screw the WYSIWYG, I’m a control freak I guess.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Stripping SRC from SCRIPT tags’ is closed to new replies.