I just completed 14 Days of WordPress Plugins + 7 Bonus Plugins!

Plugin: Auto-hyperlink URLs

This plugin has been updated! Comments to this post are now closed. For the latest download, documentation, and link for posting new comments related to this plugin, visit the plugin’s new homepage at:
http://coffee2code.com/wp-plugins/auto-hyperlink-urls
Name:
Auto-hyperlink URLs
Author:
Scott Reilly
Version:
2.01
Last updated:
10 October 2004
Description:

Auto-hyperlink text URLs in post content and comment text to the URL they reference. Does NOT try to hyperlink already hyperlinked URLs. Improves upon WordPress’s default make_clickable function, along with adding some configuration options (such as link truncation).

Notes:

This plugin seeks to address certain shortcomings with WordPress’s default auto-hyperlinking function (make_clickable()) (which itself was borrowed from phpBB). This tweaks the pattern matching expressions to prevent inappropriate adjacent characters from becoming part of the link (such as a trailing period when a link ends a sentence, links that are parenthesized or braced, comma-separated, etc) and it prevents invalid text from becoming a mailto: link (i.e. smart@ss) or for invalid URIs (i.e. http://blah) from becoming links. In addition, this plugin adds configurability to the auto-hyperlinker such that you can configure:

- If you want auto-hyperlinked text URLs to only show the hostname
- If you want auto-hyperlinked text URLs truncated after N characters
- If you want auto-hyperlinked text URLs to open in new browser window or not
- Text to come before and after the link text for truncated links

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

Installation:
  1. Download the file autohyperlink-urls.zip and unzip it into your /wp-content/plugins/ directory.
    -OR-
    Copy and paste the the code ( autohyperlink-urls.phps ) into a file called autohyperlink-urls.php, and put that file into your /wp-content/plugins/ directory.
  2. Optional: Modify any configuration options (presented as defaults for the arguments to the function hyperlink_urls())
  3. Activate the plugin from your WordPress admin ‘Plugins’ page.
Functions:
[I’ve defined the $num_posts arg as 2 for all of the examples in order to limit the amount of sample output.]

function c2c_hyperlink_urls ($text, $mode='0', $trunc_before='', $trunc_after='...', $open_in_new_window=true)

  • $text : The text to search for plain-text URLs which should be hyperlinked
  • $mode : How the text part of the newly created hyperlinks should appear. Assume as an example “http://wordpress.org/support/10″
    • 0 = The full text of the URL (ie. “http://wordpress.org/support/10″)
    • 1 = Host-only (ie. “http://wordpress.org”)
    • 11+ = (Any number greater than 11 will result in only that many characters appearing in the link.)
  • $trunc_before : Text/HTML to appear before each link created when $mode is 0 or 11+ and truncation occurs
  • $trunc_after : Text/HTML to appear after each link created when $mode is 0 or 11+ and truncation occurs
  • $open_in_new_window : Boolean value (either ‘true’ or ‘false’) to determine whether all created hyperlinks should open a new window when the link is clicked by a visitor; default is ‘true’.
Tips & Examples:

Example:

“wordpress.org”, appearing un-hyperlinked in post text or comment text, becomes:
<a href=”http://wordpress.org” title=”http://wordpress.org” target=”_blank”>wordpress.org</a>

Assume the following text appears in a post/comment: “http://www.somesite.org/with/a/very/long/url/that/may/break/your/sites/layout”

$mode = 0
=> http://www.somesite.org/with/a/very/long/url/that/may/break/your/sites/layout

$mode = 1, $trunc_before=’[', $trunc_after=’]’
=> [www.somesite.org]

$mode=25
=> http://www.somesite.org/w…

Related Links:
  • WordPress Support Forum announcement for Auto-hyperlink URLs
Release Log:
  • 10 Oct 2004 : v2.01 — Fix to once again prevent linking already hyperlinked URL
  • 27 Sep 2004 : v2.0 –
    • Plaintext URLs can now begin, end, or be all of the post and it will get auto-hyperlinked
    • Incorporated some WP1.3 regular expression changes to make_clickable()
    • Added “gov” and “edu” to the list of common domain extensions (for Class B domain support)
    • No longer displays the protocol (the “http://” part) in the displayed link text
    • Dropped support for auto-linking aim: and icq:
    • Prepended function names with “c2c_” to avoid potential future conflict with other plugins or the WordPress core
    • Changed license from BSD-new to MIT
  • 13 Jul 2004 : v1.01 — Slight tweak to prevent http://blah from becoming a link
  • 13 Jul 2004: v1.0 — Complete rewrite
  • 08 Jul 2004 : v0.9 — Released to the public
Copyright & Disclaimer:

Copyright (c) 2004 by Scott Reilly (aka coffee2code)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgements:
This plugin is an improvement over code that originated with phpBB and further modified by WordPress.

108 Responses to “Plugin: Auto-hyperlink URLs”

  1. I just activated it after grabbing the smilies plugin and it broke the smilie plugin…they are all linked back to my site via http://blah so your code works…I am going to try and
    tweak it so it will ignore links with smilie in it…

  2. elpierco replied on

    Ahh I have never worked with php so I am not really sure how to modify it basically I want to add a clause that if smilies is part of the url then dont convert it…could you help me out
    a bit…thanks el

  3. elpierco replied on

    Not to be a nuisance but I found a slight glitch. I tried to paste the url into my blog and it didnt like the “;” checkit out

    http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&;chap=6

    I have a friend at work that knows some php I am going to run my problems by him tomorrow I will let you know if I figure anything out. This is such a brillant pluggin…

  4. elpierco replied on

    weird yours linked it just fine…mine left off the ;chap=6 from the link

  5. Turns out WordPress has something like this plugin already. Except it only auto-hyperlinks URLs in comments. However, it does have the unfortunate knack of picking up a trailing “.” (so that if you put the URL at the end of a sentence and end it with a period, the period becomes part of the link). I guess sit tight and I’ll see about modifying the WordPress function a bit. In my initial attempts to get it to auto-hyperlink in the post text, it didn’t always do it when it should’ve, though except for the trailing-period thing I mentioned above, it seems to be a champ in the comments section.

  6. elpierco replied on

    Scott I have been tinkering with the PHP code but no luck so far resolving the smilie issue. Here is the link that I am trying to search for
    http://beatloverradio.com/wp-images/smilies/* if this is found I dont want it to be auto converted. Here are my two ideas

    1. within your code if I could search for that string and if it is found then tell the replacement function not to replace it
    2. Have the function imediatly sort out these refrences in the $text before passing it on to the rest of the function…

    I have a feeling the first approach is going to be the better one

  7. Scott, where can I get WP plug-in?

    I installed yours, but I got the classic

    
    Warning: Cannot modify header information - headers already sent by
    error. I checked and there is nothing before the &lt;?php or after the ?&gt;.

    I mostly just need it for comments, so either one would be fine for me. Thanks again!

  8. Nevermind, I found it. It was in a different plug-in. Sorry.

  9. elpierco: I’m not sure what you’re trying to do. Are you trying to write un-hyperlinked text like http://beatloverradio.com/wp-images/smilies/ and not have this plugin link it (much as how it isn’t linked where I just wrote it)? Or are you saying text is getting auto-linked before it can be evaluated by the smilie plugin? Also, what smilie plugin are you referring to?

    Ruby: WP has an auto-hyperlinker built in, but it’s only activated for the comments text. So if you simply type a text link into a comment, WP will auto-link it for you. I’m looking into tweaking it out if I can and then having it apply to post text as well.

  10. I was looking for something like this, having just modified wp-mail.php do do something similar for incoming emails, but I would much rather have this a system wide preference/option. Is that what you are aiming for when you say “I’ll see about modifying the WordPress function a bit”?

    I’m wondering if I should wait on your work.

    By the way, the function I found also truncates the displayed link to a set size, which is a big help to not breaking a fixed pixel layout.

    I’m happy to share.

  11. It’s not too fond of nested https:

    http://jigsaw.w3.org/css-validator/validator?uri=http://www.frankentosh.com/b2/version3.css

    Especially if you try to wrap them inside an a tag, it picks up the 2nd http and posts it as text.

    Valid CSS

  12. And it didn’t do it there…. hmmm.

  13. Plugin updated to v1.0

    This plugin has been updated to v1.0. It improves upon WordPress’s built-in auto-linking function, make_clickable(). The problems mentioned above should no longer be an issue. Also, it now has the ability to truncate link text after N characters, present links only by their hostname, and to output text before and/or after each link that gets truncated.

    To upgrade, just overwrite your previous autohyperlink_urls.php file with this one, perform any configuration customizations you want, and you should be good to go.

  14. It’s looking good now, Scott. Thanks for updating it.

  15. Scott,
    Unfortunately, this version seems to have broken deleting posts in WP. I went to delete a post after activating your plugin and got the following message:
    Warning: Cannot modify header information - headers already sent by (output started at /home/geodog/public_html/strangelove/wp-content/plugins/autohyperlink-urls.php:109) in /home/geodog/public_html/strangelove/wp-admin/post.php on line 474

  16. That warning usually indicates that there is a space before the opening &lt;?php or after the ending ?> of the file. Can you verify if that is the case or not? (Try obtaining the plugin file via the .zip and not the .phps if you couldn’t find a space and if you originally hadn’t obtained the file from the .zip).

  17. My bad. The copy from the zip file works perfectly. Sorry to bother you.

  18. Not a bother. Glad your problem was resolved.

  19. I like this. But just one little problem. It doesn’t have ‘gov’ in the list of ‘common URLs’. Since I work for the U.S. Geological Survey (www.usgs.gov), this showed up pretty fast. I added it to the list. Here’s a patch in case you want to add it to the default:

    — autohyperlink-urls.php Wed Aug 11 09:13:54 2004
    +++ autohyperlink-urls.php.orig Wed Aug 11 09:15:50 2004
    @@ -69,7 +69,7 @@
    function truncate_link ($url, $mode=’0′, $trunc_before=”, $trunc_after=’…’)
    {
    if (1 == $mode) {
    $url = preg_replace(”/(([a-z]+?):\/\/[a-z0-9\-\.]+).*/i”, “$1
    “, $url);
    - $url = $trunc_before . preg_replace(”/([a-z0-9\-\.]+\.(com|org|
    net|us|gov|info|biz|ws|name|tv)).*/i”, “$1″, $url) . $trunc_after;
    + $url = $trunc_before . preg_replace(”/([a-z0-9\-\.]+\.(com|org|
    net|us|info|biz|ws|name|tv)).*/i”, “$1″, $url) . $trunc_after;
    } elseif (($mode > 10) && (strlen($url) > $mode)) {
    $url = $trunc_before . substr($url, 0, $mode) . $trunc_after;
    }
    @@ -85,8 +85,8 @@
    “‘\1‘ . truncate_link(”$2″
    , “$mode”, “$trunc_before”, “$trunc_after”) . ‘
    ‘”,
    $text);

    - // Hyperlink common URLs *.(com|org|net|us|gov|info|biz|ws|name|tv)(/*)
    - $text = preg_replace(”#([\n\(\[ ])([a-z0-9\-\.]+)\.(com|org|net|us|gov|info
    |biz|ws|name|tv)(\/[a-z0-9\-\.\~\/]+)?((?:/[^,< \n\r]*)?)#ie",
    + // Hyperlink common URLs *.(com|org|net|us|info|biz|ws|name|tv)(/*)
    + $text = preg_replace("#([\n\(\[ ])([a-z0-9\-\.]+)\.(com|org|net|us|info|biz
    |ws|name|tv)(\/[a-z0-9\-\.\~\/]+)?((?:/[^,< \n\r]*)?)#ie",
    "'\1 txt>‘ . truncate_link(”$2.$3$4″, “$mode”, “$trunc_before”, “$trunc_after\
    “) . ‘‘”,
    $text);

  20. Oops. Definitely an oversight on my part. It’ll be in the next release. Thanks, Stan!

  21. Stephen replied on

    I believe I have found another bug in your plugin. If I create an entry with http://www.test.com, it’ll hyperlink it as normal. But if I then write a comment with and mention http://www.test.com, it won’t link to it.

    However, without your plug-in it would have linked to the site in the comment as normal.

    Or more simply, your plug-in auto-hyperlinks to URLs in the blog entry, but deactivates the normal hyperlink functionality in the comment.

    Note that this only applies to http://www.test.com. If I wrote a comment with http://www.test.com, it would hyperlink to it as normal.

  22. Hmm, then again it’s linking as normal on your blog. I assume you’re using your own plug-in. (Are you?)

    If so, any idea why it might not link on other sites??

  23. […] udes/template-functions-category.php on line 65 — dan_clavin @ 10:14 [09.21.2004]

    http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ _________________________________________________________________ Is your […]

  24. […] ott @ 6:52 pm Got a couple plug-ins working to make WordPress even easier to use! Auto-Hyperlink helps improve the auto-linking of URLs in the Blogs. I […]

  25. Plugin updated to v2.0

    This release features these changes:

    * Plaintext URLs can now begin, end, or be all of the post and it will get auto-hyperlinked
    * Incorporated some WP1.3 regular expression changes to make_clickable()
    * Added “gov” and “edu” to the list of common domain extensions (for Class B domain support)
    * No longer displays the protocol (the “http://” part) in the displayed link text
    * Dropped support for auto-linking aim: and icq:
    * Prepended function names with “c2c_” to avoid potential future conflict with other plugins or the WordPress core
    * Changed license from BSD-new to MIT

  26. The plugin fails at the following case:

    <a href=”http://something.com/blah/blah/”>something.com</a>

    It tries to link-ify the text in the middle, when this text is obviously already a link.

  27. Mark: Fixed in v2.01. Thanks for pointing the problem out!

  28. […] dkind.de test Sonntag, 10.10.2004, geschrieben am sp?ten Nachmittag

  29. This is a great plugin, but… when I wrote for example http://www.dreamweb.com.pl I’ve got a link to http://www.dreamweb.com and non clickable ‘.pl’ at the end. :(

  30. OK, I’ve found how to fix it. Now it’s ready to use.
    Forget about my previous comment.

  31. Hi Scott,

    I’m using your Plugin on two blogs. on suedkind.de it works fine. On projektguerilla.de a problem occurs on the category pages.
    Have a look at projektguerilla.de/archiv/category/all-about-blogging/. You’ll see that the entered URL is not displayed as a link.

    Concerning projektguerilla I’m using the Alpha Wordpress Version and the Kubrick-theme of binarybonsai.com. Do you think they interfere with your plugin?

  32. Same problem on my site! The URL dosen’t show as a “URL”. Just as pure text :\

    The plugin is activated!

    My site ” http://www.dillogdall.com ” In Norwegian…

  33. I installed our plugin and got the same problem.. it’s not working… I’m using plain wp1.2 ,,, haven’t switched over to mingus,,, do I need to switch over to mingus?

  34. […] ?????? ???????_blnk??? ??????????URL?Auto-hyperlink URLs? ??????????????URL? […]

  35. I’ve run into an odd little problem. The archives on my site are ported from some old hand-coded HTML, which didn’t use the (/p) to close the paragraphs (assume angle brackets instead of parenthesiseses there). As such, Wordpress adds in a string oe (/p)s at the end of the entry, one for each (p) in the entry. And my posts frequently end with a URL. When the plug-in sees the URL followed by a string of (/p)s, it’s interpreting those (/p)s as part of the URL, shoving them into the link and causing various odd problems as a result. Basically, I end up with a link with a bad URL and which displays a quote sign and a close angle bracket as part of the link text.

    For an example, scroll down to the end of http://AAUGH.com/wordpress/index.php?m=200008

  36. […] ” rel=”bookmark”>test 1

    obecn? • @13:51:24

  37. Is there an easy way to add this functionality to the feeds as well?

    I get a lot of people reading with bloglines, and complaining that they can’t click on links directly.

  38. One thing of note for users using URLs with the two-letter country code suffixes (and wanting to hyperlink plaintext URLs that AREN’T prepended with “http://”)… the plugin by default only recognizes “.us”. If you want to add support for your country code, look for this bit in the plugin’s code:

    (com|org|net|gov|edu|us|info|biz|ws|name|tv)

    Then add your country like so (I’ll assume you want to add “.uk”):

    (com|org|net|gov|edu|us|info|biz|ws|name|tv|uk)

    In the future I may add support for other country codes (or perhaps all of them, depending on my assessment of feasibility).

    But just to be clear: Beginning a valid plaintext URL with “http://” will ALWAYS result in that being created into a proper link, regardless of what country code you may be using. The country code limitation only comes into play if you don’t prepend “http://”, such as writing “example.com.uk”, which by default won’t consider the “.uk” as part of the link.

    Nat: When I update this plugin I’ll try to ensure that your problem gets fixed, but for now I’ve noted that what you’ve described is true.

    Adam: When you manually create links in your posts (i.e., actually using the link tags and not relying on this plugin), do your links remain links in the feed? A quick glance at the WP code suggests that all tags get stripped, but if your manual links survive then I’ve mistook what is happening.

  39. Bug: your plugin seems to hyperlink blah.com in <a href=”http://blah.com”>visit blah.com</a>

  40. This text will generate a false link:

    … after all…government …

    Multiple dots in a row shouldn’t be recognized as a URI.

  41. […] WordPress Plugins http://codex.wordpress.org/Plugins (I installed the following plugins: Auto-hyperlink URLs, Google Highlight) This […]

  42. […] /else into my templates again, I installed Scott Reilly’s Auto Hyperlink URL plugin: […]

  43. An example of the bug reported by Denis in comment #39:

    http://marc.abramowitz.info/archives/2005/03/11/bug-in-auto-hyperlink-urls-wordpress-plugin/

  44. james replied on

    I’m getting an error - using wp 1.5, after I add the plugin it is trying to create multiple headers while in the admin area. It seems as if the final result on the /wordpress page is working ok, but the errors scare me. Any ideas?

    Also, the automatic email updater plugin.. when I send an email with a regular text url i.e. http://www.msn.com, it gets formatted in my email as (www.msn.com) and does not show in the blog (the parentheses represent brackets) - any way to fix this? Otherwise, awesome plugin!

  45. james replied on

    the error is also stopping me from deleting posts, please help :)

  46. Scott replied on

    Denis and Marc: I will be looking into it within the week.

    Mark: Fixed in the latest version of the plugin, to be released very soon.

    james: The error is probably caused by the inclusion of spaces before the <?php at the start of the file, or more likely, spaces or other characters after the ?> at the end of the file.

  47. Hi,

    I have text emails that come through like this:

    Those two little braket things somehow stop the script from truncating the hyperlink.

    I know so little about php that I don’t know where to add them into the script to make the script take them out too.

    Can anyone help me with this?

    Kindly,
    John

  48. well it looks like the link didn’t get added to my post above.

    But the links start with . Those two characters are the problem.

    Thanks.
    John

  49. geeshh… I can’t seem to add those characters to my posts. But it is the less-than and greater-than characters. The one over the comma on your keyboard and the one over the period.

    My hyperlinks start with the less-than sign and they end with the greater-than sign. Can I somehow make it so the script will still work when my incoming text hyperlinks are surrounded by these two characters?

    Kindly again,
    John

  50. […] el identificador. Sin salir de Coffee2code podemos encontrar, entre otros, plugins para: enlazar autom?ticamente urls y emails, provocar que los comentarios de […]

  51. […] make_clickable function, along with adding some configuration options (such as link truncation). http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ Download: http://www.coffee2code.com/wp-plugins/autohyperlink-urls.zip it work […]

  52. […] os de la bitácora respectivamente, permitiendo añadir imágenes asociadas al usuario. […]

  53. […] os de la bitácora respectivamente, permitiendo añadir imágenes asociadas al usuario. […]

  54. […]

    auto-hyperlink-urls does just what it says. Yay! no more doing that crap manually. http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ […]

  55. Madolyn replied on

    I’m not sure now if I need this plugin or not - have copied from the .phps, modified (also added the au TLD since I’m in Australia), uploaded, activated, and it’s working and I’m not getting errors.

    However, sometimes I mention former domains of mine and I *don’t* want them linked because either they go nowhere (parked page or DNS error results) or to someone else’s site (if someone else has since registered the domain name). And sometimes I want an unlinked full URL appearing in my text. So what I want now is a way to prepend a “do not link” string in my entry with some kind of unusual string that the plugin will interpret as “do not URLify any characters between here and the next space”.

    Any chance of that?

  56. […] e acronym replacer plugin is working afterall…hehehe… Made some changes to the autolink plugin to cre […]

  57. […] gs to “lazy link” a url anymore. This plugin does it for you. Grab it here: […]

  58. John Foulds replied on

    I’m getting the same problem as Matt Gertler reported last December: if an URL finishes a line, WP adds as which this plugin adds to the URL…

  59. Wonderful — I love your plugins. They are so practical and easy to understand. Most bang per line of code.

    Just installed it on http://eggcorns.lascribe.net/contribute (400+ commentaries, many with messy URLs).

    Some URLs did get messed up, btw — strange html entities appearing. Obviously some sort of conflict with a formatting function. I fixed it by lowering the “priority” setting in add_filter to “2″.

  60. […] Faça links automáticos com o Plugin: Auto-hyperlink URLs by Scott Reilly. […]

  61. […] Faça links automáticos com o Plugin: Auto-hyperlink URLs by Scott Reilly.   […]

  62. Hi,
    actually I am working on a german translation (and update) on your plugin. This dedicated german update will have implemented some of the main sites and - in addition - some special unix (Ubuntu) links. If this is ok, please let me know as I would like to link this page on my web-site.

  63. […] Derzeit arbeite ich gerade an einer Anpassung an dem Plugin ‘Auto-Hyperlink‘. Dieses interessante Plugin verwandelt spezielle Key-Words direkt in Hyperlinks. Allerdinsg ist das englische Original auf die entsprechenden anglo-amerikanischen Links spezialisiert. Aus diesem Grund passe ich dieses Script etwas an. Jeder der Lust hat, kann dieses natürlich entsprechend ergänzen. Ich persönlich finde die Hyperlinks in den Artikeln sehr hilfreich. Der Original-Autor ist natürlich informiert. […]

  64. […] ?????GetRecentComment???????WrapWord???????????????????????? ????????AutoHyperLink???URL? […]

  65. […] Auto-hyperlink URLs verlinkt URLs automatisch. […]

  66. Pierre replied on

    Hi,

    thank you, you’re plugin works very well but there is a little bug when the function who format the link tag is followed by a html tag like li, br, dd etc… then the link appear like this :
    yourlink.com />
    text to continue…
    Is there’s a way to correct this please :) ?
    TIA

  67. This is a great plu-in, I am sick of going in and fixing urls. One question:

    I see you strip the http:// and that is great! Can I just strip everything after the first / rathe than pick a number?

  68. […] http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ […]

  69. […] Google Sitemaps 9 Spam Karma 2 - Reloaded 5 Related Posts 3 WP-ContactForm 6 Email Notification Plugin StatTraq 2 Adsense Deluxe 5 Akismet 4 Ultimate Tag Warrier 3 Feedburner Feed Replacement 3 WP-Amazon 3 Auto hyperlink URLs 2 Page Navigation 2 Angsuman’s Feed Copyrighter 2 WordPress Database Backup 2 IImage Browser 2 Paged Comments 2 Viper’s Plugins Used 2 Popularity Contest 2 WP-Googlestats 2 Subscribe to Comments AJAX Spell Checker Recent Comments Audio Play Rate My Stuff ViewLevel2 evermore PHP Exec Most Wanted Autometa WP-Cron Quicktags WP Adsense No Duplicate Comments Polite-ifier CSS Compress Del.icio.us Bookmark This Flickr Gallery Heavyweight Categories Live Comment Preview Relative Dates RunPHP Extract Terms Terms2tags Force Word Wrapping WP-cache WordPress From/Where WP Hardened Trackback WordPress Hashcash Adsense Logger Bad Behavior Cat 2 Tag CA Chitika Chitika eMiniMalls Code AutoEscape Paged Comment Editing Optimal Title Better Feed Click Counter IP 2 Nation Random Words Transpose e-mail Batch Categories Enhanced View PXS Mail Form SH-Autolink Search Meter Search Pages Search Reloaded Smart Update Pinger Taggerati x-Dashboard CG Powerpack PhotoPress Subscribe Me Secure Image Ak-Bookmark/ak-subscribe Blogs of the Day (couldn’t find URL) Get RSS (couldn’t find URL) […]

  70. […] http://www.coffee2code.com/archi… - Home - […]

  71. This plugin seems incompatible with PHP Markdown. When Markdown is activated Autolink doesn’t work. No bug or strange behaviour, just no clickable links.

  72. […] Auto-hyperlink URLs […]

  73. […] I just got the AutoURL plugin http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ and am testing it. […]

  74. […] Auto-hyperlink URLs (download) […]

  75. […] coffee2code.com » Plugin: Auto-hyperlink URLs Plugin: Auto-hyperlink URLs (tags: wordpress plugins plugin blogging blog lazysheep) […]

  76. […] […]

  77. […] Faça links automáticos com o Plugin: Auto-hyperlink URLs by Scott Reilly. […]

  78. […] Autohyperlink […]

  79. Hi, and thanks for the great pluging. I found a situation similar to Nat’s (comment 35) but since it’s a bit different I thought I’d tell you.

    (div)email@domain.com(/div)<code>
    
    get's changed to
    
    <code>(div)(a href="mailto:macandbac@hotmail.com(/div)
    (p)&#8221; title=&#8221;mailto:macandbac@hotmail.com(/div)
    (p)&#8220;&gt;email@domain.com(/div)
    (p)(/a)(/p)

    where, of course, parenthesis represent angle brackets. Thanks again!

  80. I used to be able to click on a URL in “Outlook Express” and automatically go to the website. Now I have to cut and paste to go there. What happened?

    Smooth Sailing,
    Bob

  81. Found a bug: If you use inline CSS, and have a URL in the CSS, that URL gets linkified. Example:

    <a href=”http://www.somesite.com” style=”background: url(www.somesite.com/myimage.png); “>Some Site</a>

    The “http://www.somesite.com/myimage.png” gets turned into a clickable link. It seems your plugin’s regexp should be ignoring everything inside <> tags.

    - Sean

  82. Fixed the above mentioned bug, and the fixed version is here:
    http://www.headzoo.com/autohyperlink-urls.zip

    This will ignore URLs inside of tags, the way it should be. :)

  83. […] 1) AutoHyperLink […]

  84. Hello. The auto-linker grabs the URLs within embedded objects (WMV movies for sure, and probably all other object types).

    
    site/file.wmv</a>
    site/file.wmv</a>" /&gt;
    
    

    (Hopefully that sample code will display.)
    Basically, the object’s data= attribute, which is a URL, is getting mangled. Likewise, the param’s value= attribute is also getting linkified. This totally breaks the embedded video object.

    It sounds similar to the problematic URLs in the CSS code mentioned above. Hopefully this is an equally quick fix.

    I will be happy to help you test it if that would help. Until a fix is posted, I guess I will have to disable your plugin. :-(

    Thanks for creating the plugin, and thanks in advance for helping to fix this bug.

  85. It breaks on image ALT tags wherein a url is contained e.g. very commonly found with Image Shack hosted images.

  86. […] 1/ l’ordre des menus 2/ logo header ==> voir templates guides 3/ ID 1 not found ==> ok c’est Posts 4/ jouer avec les emails 5/ reconnaissance automatique des liens ==> c’est fait Mon CMS de rêve - interaction email - cache - blog vs pages - automatic link recognition - simple RTE & add images - easy translations & concurrent links - facilement changement de hostname ex: php1.nethence.com => lala.autredomaine.com - recevoir un email lorsqu’un commentaire est ajouté rubyforge.org/projects/ty… WORDPRESS xavier.borderie.net/wp-fr… wordpress-fr.net/ free blog: wordpress.com/ outlook: wordpress.com/tag/outlook… ?? dev.wp-plugins.org/wiki/U… order / sort menu : wordpress.org/support/top… wordpress.org/support/top… Autolink: http://www.coffee2code.com/archi… http://www.coffee2code.com/wp-pl… dotclear super thèmes! http://www.brindilles.net/index…. http://www.dotclear.net/trac/wik… xoops http://www.onlamp.com/pub/a/onla… phpwebsite.appstate.edu/ moodle.org/ Plone (heavy as typo3) zope modx drupal e107 BloxPress Theme leita.wordpress.com/tag/i… http://www.sybase.fr/ […]

  87. […] Auto-hyperlink URLs - ?????? […]

  88. […] just testing the url function what happens if i type simply cnn.com or if i type americanapparel.net or if i type http://www.coffee2code.com/archives/2004/07/08/plugin-auto-hyperlink-urls/ or even if i type someone@renegademarketing.com […]

  89. Great plugin,

    Could you make an option not to pick up urls within blockquote, pre, and code tags.

  90. […] Auto-hyperlink URLs Auto-hyperlink text URLs in post content and comment text to the URL they reference. Won’t try to hyperlink already hyperlinked URLs. Improves upon WordPress’s default make_clickable function, along with adding some configuration options. […]

  91. marvin replied on

    Works great on WP2.0.5!

    I tweaked it to also allow .uk and .jp domains and it works fine.

    However I also using ‘Get Custom Field Values” plugin to display some info within the loop. I have tried to add code in the auto-hyperlink plugin to allow text in my cusotm field values to also be hyperlinked, but I can’t get it to work.

    I am trying to put this at the bottom of the plugin:
    add_filter('c2c_get_custom', 'c2c_hyperlink_urls', 9);

    It doesn’t seem to work… any ideas how I can tweak it to include my output WITHIN the loop from the cutom fields?

    thank you!

  92. […] Auto-Hyperlink URLs - If I forget to assign a formal hyperlink to an internet address, this plug-in tries to help. […]

  93. […] ?????????????????????????????? coffee2code ?Auto-hyperlink URLs ???blockquote ? code ??????????????????????????????????????????? […]

  94. Great plugin. Still trying out all my 315 posts to check for any error in links. I rate you 5/5!

    Thank you!

  95. how can I modify the code to add a “rel=” attribute to all links?

  96. I just want you to know that I love you. This fixed a huge headache for me.

  97. How would I modify the code to always add a specific ‘rel=’ attribute to all links?

  98. Hi:

    I am completely new to WordPress…it is awesome so far…and I am working my way through the documentation. Is there a quick and dirty way to make a comment a hyperlink?

    I don’t see it yet.

    Regards and thanks in advance,

    Tim

  99. Rubira replied on

    List of all country codes:

    biz|com|edu|gov|int|mil|net|org|pro|aero|arpa|coop|info|name|nato|tv|us|br|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|fx|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zr|zw|

  100. How would I put an exception in the auto-hyperlink rules? For instance, I do not want text containing my website address, TvTanks.com, to be hyperlinked when posting on TvTanks.com so as to avoid linking back to myself. Thanks for a great plugin!

  101. […] 11. Auto-hyperlink URLs Auto-hyperlink text URLs in post content and comment text to the URL they reference. Does NOT try to hyperlink already hyperlinked URLs. Improves upon WordPress’s default make_clickable function, along with adding some configuration options (such as link truncation). […]

  102. […] 11. Auto-hyperlink URLs Auto-hyperlink text URLs in post content and comment text to the URL they reference. Does NOT try to hyperlink already hyperlinked URLs. Improves upon WordPress’s default make_clickable function, along with adding some configuration options (such as link truncation). […]

  103. […] Auto-hyperlink URLs: convierte las direcciones en links. […]

  104. […] Auto-hyperlink URLs: convierte las direcciones en links. […]

  105. […] Auto-hyperlink URLs: convierte las direcciones en links. […]

  106. […] Auto-hyperlink URLs: convierte las direcciones en links. […]

  107. […] Auto-hyperlink URLs: convierte las direcciones en links. […]

  108. […] Auto-hyperlink URLs - 自动将URL转æ¢ä¸ºé“¾æŽ¥ã€‚ […]