Identify External Links

About

This plugin will add a special CSS class to all links in your entries and in your comments that go to external sites (sites other than your site). For more complex external link identification needs, check out Link Indication.

Download

Instructions

Copy and paste the text. Save it in a file named identify-external-links.php. Make sure there are no spaces before the opening <?php or after the closing ?>. Activate it from within the WordPress admin interface. You can then use a.extlink { } in your CSS to style it.

You can also edit a setting in the top of the plugin to add target="_blank" to external links, so that they open in a new window (this is from popular demand… please note that this is an annoying thing to do to your readers.)

Versions

  • Version 1.3 Filter priority has been upped to 999 to get around some issues with markup plugins… option added to do target="_blank"
  • Version 1.2 Doesn’t apply extlink class if there is an image within the link
  • Version 1.1 Works for subdomains now (thanks h0bbel!)
  • Version 1.0 Initial release

I’ve spent a lot of time writing this code and supporting it. If you derive some benefit from this code, please consider showing your gratitute in a more tangible
way. Thanks!

I have received $0 this month for my coding efforts.

Donate with PayPalAmazon.com Wishlist


190 Responses to “Identify External Links”

Leave a Reply