Support » Fixing WordPress » change external link code inserted when adding new post: file?

  • I want to be able to add external links the current system adds target=”_blank” which is not valid xhtml strict code. I would prefer it inserted onclick=”;return false;” which is valid code. How can I modify this function? What file inserts this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I found a file at location:


    this is the file that creates the code from the pop up menu that your insert your url into the post, and choose whether you want it to open in same window or new window. I can see the javascript that does this toward the bottom of the js file. What can I change to do this? I dont want to add a plugin or add a javascript call to my pages to change on the fly or anything like that… i want the code to insert the correct syntax.

    Here are two threads that discuss this– maybe one of them would work for you.

    Solution using a Plugin:

    Another approach using javascript:

    thank you. i understand those solutions but I dont want to add a plugin that swaps out on fly, or additional javascript on each page. My solution is actually a lot better than those methods which is a simple onclick javascript action that requires no additional server calls on page load. I want tinymce, which is the behind the scenes WYSIWYG that is used for posting, insert the syntax of my choice rather than target=”_blank”. I know the files that do it, I just don’t know javascript well enough to know what to change.


    Check with this plugin:


    Shane G.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘change external link code inserted when adding new post: file?’ is closed to new replies.