Auto-hyperlink URLs

Description

Automatically turns plaintext URLs and email addresses into links.

This plugin seeks to replace and extend WordPress’s default auto-hyperlinking function. This plugin uses different pattern matching expressions than the WordPress default in order to prevent inappropriate adjacent characters from becoming part of the link (as WordPress has improved over the years, nowadays this is just a few edge cases like text links that are braced or bracketed) and it prevents invalid URIs (i.e. http://blah) from becoming links.

More significantly, this plugin adds configurability to the auto-hyperlinker such that you can configure:

If you want text URLs to only show the hostname

If you want text URLs truncated after N characters

If you want auto-hyperlinked URLs to open in new browser window or not

If you want the URI scheme (i.e. “http://”) to be stripped for displayed links

The text to come before and after the link text for truncated links

If you want rel=”nofollow” to be supported

If you wish to support additional domain extensions not already configured into the plugin

If you want certain domains to be omitted from auto-linking

This plugin will recognize any explicit URI scheme (http|https|ftp|news)://, etc, as well as email addresses. It also adds the new ability to recognize Class B domain references (i.e. “somesite.net”, not just domains prepended with “www.”) as valid links (i.e. “wordpress.org” would get auto-hyperlinked)

The following domain extensions (aka TLDs, Top-Level Domains) are recognized by the plugin: com, org, net, gov, edu, mil, us, info, biz, ws, name, mobi, cc, tv. These only comes into play when you have a plaintext URL that does not have an explicit URI scheme specified. If you need support for additional TLDs, you can add more via the plugin’s admin options page or via filter.

This plugin also activates auto-hyperlinking of text links within post/page content.

This hook allows you to custom the list of supported TLDs for non-URI scheme link auto-hyperlinking. Note that the value sent to the hook includes the default TLDs plus those added via the ‘more_extensions’ setting. Also note that the TLDs are defined as a ‘|’-separated string.

This hook allows you to specify domains that should not get auto-hyperlinked. Note that the value sent to the hook includes the value of the ‘exclude_domains’ setting. Note that only the domain (without URI scheme or trailing slash) should be specified.

Reviews

First started using this when we needed to update all our legacy content a decade-plus old to have no-follow links and auto-hyperlinks to no longer have to manually add them. Supremely helpful to us. THANK YOU! 🙂
You've made some great plugins the past decade, so we hope you feel the love!
Chris

5.0 (2016-01-26)

Highlights:

This release revives active development of the plugin after many years and includes many, many changes. Backwards compatilibility has been maintained; it just handles things better and introduces a number of new features. Some notable changes:

Introduced setting and filter to add support for preventing specified domains from getting auto-linked.

Introduced filter to support custom handlers to determine if and when text links should get auto-linked.

Improved text link detection and handling.

Links within <code>, <pre>, <script>, and <style> tags are no longer hyperlinked.

Improved support for language packs.

Fixed some minor bugs.

Added a boatload of unit tests to ensure the plugin functions as intended.

Changed to not open links in a new window by default.

Changed to no longer output the ‘title’ attribute.

Details:

New: Introduce setting to allow specifying domains that should not be automatically hyperlinked.