Manual:Opening external links in a new window

Find this function in 'YourWikifolder\includes\Skin.php' and change to:

Then create a folder and a file in 'YourWikifolder/javascript_form/getXterlinks.js', and copy and paste this into the file then save it: MediaWiki versions Tested in 1.9.3

Or you can follow ANOTHER METHOD below. This page describes how to change the MediaWiki code so that external links open in a new window.

Keep in mind that some consider it rude to force new windows on your users. Additionally, if you are using Google AdSense (or similar services) on your wiki, these links should open within the same browser ("_self) according to the policies of the Ad Service.

Customized skin and script
This method keeps the markup more compliant by avoiding the  attribute. Use a script to redirect all the links on a page instead.
 * Open the .js page corresponding to the skin. (For the Monobook skin, type   in the Search box.)
 * Create a function that parses all elements for anchor tags with a specific  (relation) attribute, such as   or.


 * Attach the function as a load event (compatible with Firefox and IE).

Version &lt; 1.5.x (? I think ?)

 * 1) Open Includes/Skin.php or Includes/Linker.php
 * 2) Find "function getExternalLinkAttributes"
 * 3) Replace   with

Note: It doesn't change already present links to open in new windows. It will only make new links you insert open in new windows. Or you can alter all the pages that have external links and then save it to make them work.

Note 2: This doesn't work for the Sidebar on v 1.5.

Version &gt; 1.5.0

 * 1) Open includes/Linker.php
 * 2) Find "function getExternalLinkAttributes"
 * 3) After   insert the following code

This works for all external links and is used by the wiki for the next page