Target Blank v1.0.3

Release Notes

  • changed: using jquery live function to register target blank on external links
  • Recommended !
    Thx for your plugin, it works well for me in 1.7.4.

  • It works very well on all external links but with infolinks and google adsense not working , I understand google adsense is in iframe but not sure with infolinks.

  • Doesn't seem to be working for me.  Links still appear in same window.

  • @Jerome Bakker is that possible to add rel-nofollow to all external links? It help us to keep spammers away.

  • <?php
    /*$external_links = $('a[href^="http://"],a[href^="https://"]').not('[target], [href^="<?php echo $vars["url"];?>"]');*/
    $external_links = $(
        ,[href^="<?php echo $vars["url"];?>"])
            ,[href^="<?php echo $vars["url"];?>"]
    $"click", function(){
    $(this).attr("rel", "nofollow");

  • Thanks Dhrup I will test this code today at night.

    So what is the best way to test this like is that works or not??

  • That code goes into same PlugIn's :-
    Just add those lines (I think;-P I never test my own code lolz)
    Test ?
    Just post some Blog or whatever with external links,
    View Source should show the "rel" tag added into the href html.

  • a few typos in comment above ;)
    $external_links should probably be renamed to something else...
    *and if you're looking forward to quashing spammers stuff ---


    Google announced in early 2005 that hyperlinks with rel="nofollow" would
    not influence the link target's PageRank. In addition, the Yahoo and Bing
    search engines also respect this attribute value.
    On June 15, 2009, Matt Cutts, a well known software engineer of Google,
    announced Matt Cutts Blog (June 15, 2009), that GoogleBot will no longer
    treat nofollowed links in the same way, in order to prevent webmasters
    from using nofollow for PageRank Sculpting. As a result of this change
    the usage of nofollow leads to evaporation of pagerank.
    In order to avoid the above, SEOs developed alternative techniques
    that replace nofollowed tags with obfuscated Javascript and thus permit
    PageRank Sculpting. Additionally several solutions have been suggested
    that include the usage of iframes, flash and javascript.

  • @JB.  Works in 1.8.01.  I must have had an incompatible/conflicting plugin in 1.7.11 or I had corrupted my copy of elgg.



Jerome Bakker

Developer @ ColdTrick IT Solutions


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2023-6-5
  • Downloads: 6169
  • Recommendations: 31

Other Projects

View Jerome Bakker's plugins