T.o.C

BWP External Links gives you total control over external links on your WordPress websites. Your visitors can easily distinguish between internal and external links, and you can make external links automatically open in a new tab/window or add a redirection page.

Add a prefix to external links. Example use would be a redirection page that warns your visitors about the danger of visiting external sites, e.g. http://yourdomain.com/out?

WordPress Multi-site compatible

Plugin Usage

Domain filtering

Under Settings > BWP External Links > Link Options you will be able to define domain filtering rules.

Subdomains

By default BWP External Links does not make links pointing to subdomains of your website/blog external. For example plugin.betterwp.net or premium.plugin.betterwp.net is considered local. If you select the opposite (i.e. “Links to all subdomains are considered external”), all subdomains will then be considered external.

You can also select a third option: ‘Links to some subdomains are considered local’. For this setting to work you must tell the plugin which subdomains to filter out, by specifying each subdomain (WITHOUT scheme and root domain) on a separate line in “Local subdomains” setting. Assuming that your website is at http://example.com, you can have something like this:

premium.theme
*.theme
plugin
theme

By specifying plugin, theme, and premium.theme you are effectively making plugin.example.com, theme.example.com , as well as premium.theme.example.com local.

With *.theme you make premium.theme.example.com and any other subdomains on theme.example.com, such as free.theme.example.com, local.

Subdomains that are not specified such as photos.example.com are considered external.

Important note: in some cases when the same subdomain name is used on multiple subdomain level, e.g. en.example.com and en.plugin.example.com, the order in which you specify each subdomain name is crucial. A simple rule to follow: the lower level a subdomain is (further from the root domain), the higher the position its name should be in the “Local subdomains” setting. So in the above example, to make both en.example.com and en.plugin.example.com local, use this:

en.plugin
en

Domains

Apart from subdomain filtering rules, you also have the option to make links to external domains become local, or forbid linking to some external domains entirely.

To make external domains local, simply type in one external domain per line (without scheme) into the “Forced local domains” setting textarea. Note that you would specify the full domain (including the TLD or extension, along with wildcard if needed), e.g. wordpress.org or *.wordpress.org instead of just wordpress.

You can do the same thing with “Forbidden domains” plus setting a replacement URL for any links to forbidden domains. Settings the replacement URL to # is a good example.

Redirection page

This is actually a favourite feature of mine.

The redirection page is often used on external links to warn you about the fact that you’re going to leave the current website, and will be on your own after confirming to leave. Sites with lots of comments and links use it, for example http://www.deviantart.com/.

BWP External Links allows you to set a prefix for any external link, and you can use such feature to construct a redirection URL, e.g. http://example.com/out.php?url=....

By default hxxp://anonym.to is available to help you anonymize links in your posts, but you can set the prefix to any custom URL on your site. Check out this Redirect external links tutorial for some tips to get a custom redirection page up and running.

Opening external links

This plugin offers three ways to open an external link: open a new tab/window for each link (‘_blank’ – this is the default setting), open just one new tab/window for any link (‘_new’) or use the same tab/window for all links.

When a new tab/window is preferred, BWP External Links also supports three methods (the rule of three anyone?) to achieve just that: use the target attribute (which was formerly not W3 compliant), use the onclick attribute (which might get blocked) or use jQuery. If jQuery is already being used on your website, I’d recommend that you use the jQuery method, it is clean and safe :).

Styling external links

With the CSS classes in hands there would be no trouble beautifying your external (or even local) links. I would just add a ‘pointing out’ icon to the end of every external link and add some ‘text-decoration’ rules if needed. You might find some icons here and a neat tutorial about this here.

As of version 1.1.3 a new CSS class, i.e. ext-image, is used instead of ext-link for any link pointing to an external image, so make sure you make good use of that one as well.

Support, Feedback, and Code Improvement

i18n (Translate the plugin)

If you are a translator, please help translating this plugin. Even if you aren't, you can become one, it is very easy and fun! If you want to know how, please read here: Create a .pot or .po File using Poedit.