Title: Problem with: onclick=&#8221;javascript:window.open
Last modified: October 27, 2025

---

# Problem with: onclick=”javascript:window.open

 *  Resolved [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * (@123nadav)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/)
 * Hello guys, how are you? I have a very strange issue on my website.
 * I actually have three identical websites in terms of design and code.
 * However, one of them is causing me problems for no reason, and I can’t solve 
   it.
 * I set up an exclusion list for several social media external links:
   [https://ibb.co/0pPj6f0H](https://ibb.co/0pPj6f0H)
 * The problem is the Facebook icon (link), The Facebook icon is an actual external
   link to my Facebook page.
 * For some reason, it doesn’t work properly with:
 * `onclick="javascript:window.open"`
 * If I’m not in incognito mode, the page opens in the same tab instead of a new
   window. when i click F12 and inspect the Facebook icon its not shows me the: `
   onclick="javascript:window.open"` for facebook. (for all the other social media
   its shows)
 * **I set up my other websites the same way, and it works fine, for example:**
    - [https://locksmithunit.com](https://locksmithunit.com)
    - [https://locksmithunit.cat](https://locksmithunit.cat)
 * **The problem is specific to this website:**
    - [https://locksmithunit.es](https://locksmithunit.es)
 * It’s important to note that the other social media icons work perfectly fine.
 * All three websites have the same plugin settings and the same code (you can check
   it using the developer tools, F12).
 * Any suggestions?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-onclickjavascriptwindow-open%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * (@talextech)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/#post-18697740)
 * I have checked and for me all the links open in a new tab, including Facebook.
   But Facebook link is missing the javascript, that’s true. But normally just the
   links having target=”_blank” should be enough for them to open in a new tab. 
   Not sure why you need the JS code on top of that.
 * Either way you will need to check whatever is adding that Javascript code as 
   it’s not added by WP External Links so I don’t know what to tell you 🙁
 *  Thread Starter [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * (@123nadav)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/#post-18697797)
 * Hi,
 * It seems the issue comes from an add-on of your plugin:
   [https://wordpress.org/support/plugin/open-external-links-in-a-new-window/](https://wordpress.org/support/plugin/open-external-links-in-a-new-window/)
 * After checking your settings page, I noticed it clearly says that the add-on 
   uses JavaScript to open new windows.
 * I am a bit concerned because when you checked my website earlier, it appears 
   that this add-on injects JavaScript, but it may not have been recognized. I also
   discovered why the script is not added to my Facebook link.
 * My website URL is **[https://locksmithunit.es](https://locksmithunit.es)**
 * and my Facebook page is **[https://www.facebook.com/locksmithunit.es/](https://www.facebook.com/locksmithunit.es/)**
 * It seems the add-on automatically excludes links that contain my domain name,
   even when it is only part of the Facebook username.
 * I am not sure if there is a solution for this, but based on your response, I 
   would like to know if this add-on is necessary, or if it would be better to simply
   delete it.
 * Thank you in advance for your clarification.
 *  Plugin Author [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * (@talextech)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/#post-18697915)
 * Hi,
 * Well, it’s not an add-on actually, just a different plugin of ours. But if you
   just want the links to open in a new tab you don’t need it. As those links already
   have targe=”_blank”.
 *  Thread Starter [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * (@123nadav)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/#post-18698773)
 * [@talextech](https://wordpress.org/support/users/talextech/) in the past when
   you was install the [External Links – nofollow, noopener & new window](https://wordpress.org/plugins/wp-external-links/)
   plugin.
 * it was force you to install the [open-external-links-in-a-new-window](https://wordpress.org/support/plugin/open-external-links-in-a-new-window/)
   plugin.
 * Anyway, i delete this plugin. i am not understand what special about him, xHTML
   is old, today WordPress read and support html5 so is useless… i delete the plugin.
 * Thank you,
 * Regards,
 * Levi

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

The topic ‘Problem with: onclick=”javascript:window.open’ is closed to new replies.

 * ![](https://ps.w.org/wp-external-links/assets/icon-256x256.png?rev=2103983)
 * [External Links - nofollow, noopener & new window](https://wordpress.org/plugins/wp-external-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-external-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-external-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-external-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-external-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-external-links/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Nadav Levi](https://wordpress.org/support/users/123nadav/)
 * Last activity: [7 months, 1 week ago](https://wordpress.org/support/topic/problem-with-onclickjavascriptwindow-open/#post-18698773)
 * Status: resolved