WP External Links (nofollow new tab seo) – WordPress plugin Free download

Click to Download

WP External Links (nofollow new tab seo)

Description

Manage external and internal links on your site.

=== NEW: Version 2 ===
WPEL plugin was completely rebuilt and has lots of new features, like “noopener”, font icons, internal links options and WPMU settings.

Features

Manage external and internal links
Open links in new window or tab
Add “follow” or “nofollow”
Add “noopener” and “noreferrer” (for security)
Add link icons (font icons: font awesome, dashicons)
Set other attributes like title and CSS classes
Scan complete page (or just posts, comments, widgets)
SEO friendly

And more…

Network Settings (WPMU support)
Use template tag to apply plugin settings on specific contents
Set data-attribute to change how individual links will be treated
Use built-in actions and filters to implement your specific needs

Easy to use

After activating you can set all options for external and internal links on the plugins admin page.

On the fly

The plugin filters the output and changes the links on the fly. The real contents (posts, pages, widget etcetera) will not be changed in the database.
When deactivating the plugin, all contents will be the same as it was before.

Requirements

PHP version 5.3 or up
WordPress version 4.2 or up

If you want support for older versions of PHP or WordPress then download and install version 1.81 of this plugin.

Sources

Documentation
FAQ
Github

Like this plugin?
Rate it to support the development of this plugin.

Documentation

After activating you can set all options for external and internal links.

Data attribute “data-wpel-link”

Links being processed by this plugin will also contain the data-attribute data-wpel-link.
The plugin could set the value to external, internal or exclude, meaning how the
link was processed.

You can also set the data-attribute yourself. This way you can force how the plugin will process
certain links.

When you add the value ignore, the link will be completely ignored by the plugin:

<a href="http://somedomain.com" data-wpel-link="ignore">Go to somedomain</a>

Action “wpel_link”

Use this action to change the link object after all plugin settings have been applied.

add_action( 'wpel_link', ( $link_object ) {
    if ( $link_object->is_external() ) {
        // get current url
        $url = $link_object->getAttribute( 'href' );

        // set redirect url
        $redirect_url = '//somedom.com?url='. urlencode( $url );
        $link_object->setAttribute( 'href', $redirect_url );
    }
}, 10, 1 );

The link object is an instance of WPEL_Link class.

Action hook “wpel_before_apply_link”

Use this action to change the link object before the plugin settings will be applied on the link.
You can use this filter f.e. to ignore individual links from being processed. Or change dynamically how
they will be treated by this plugin.

add_action( 'wpel_before_apply_link', function ( $link ) {
    // ignore links with class "some-cls"
    if ( $link->has_attr_value( 'class', 'some-cls' ) ) {
        $link->set_ignore();
    }

    // mark and treat links with class "ext-cls" as external link
    if ( $link->has_attr_value( 'class', 'ext-cls' ) ) {
        $link->set_external();
    }
}, 10 );

Filter hook “wpel_apply_settings”

When filter returns false the plugin settings will not be applied. Can be used when f.e. certain posts or pages should be ignored by this plugin.

add_filter( 'wpel_apply_settings', '__return_false' );

See FAQ for more info.

Screenshots

Link Icons
Admin Settings Page
WPMU Network Settings Page

Installation

Go to Plugins in the Admin menu
Click on the button Add new
Search for WP External Links and click Install Now
Click on the Activate plugin link

Install Older Version

When you have an older version of WordPress (version 4.1 or less) or PHP (version 5.2.x) you can only use an older
version of this plugin.

Click to Download version 1.81
Go to Plugins in admin
Click New Plugin
Click Upload Plugin
Choose the downloaded file and click Install Now
Click on the Activate plugin link

FAQ

Installation Instructions

Go to Plugins in the Admin menu
Click on the button Add new
Search for WP External Links and click Install Now
Click on the Activate plugin link

Install Older Version

When you have an older version of WordPress (version 4.1 or less) or PHP (version 5.2.x) you can only use an older
version of this plugin.

Click to Download version 1.81
Go to Plugins in admin
Click New Plugin
Click Upload Plugin
Choose the downloaded file and click Install Now
Click on the Activate plugin link

I want certain posts or pages to be ignored by the plugin. How?

Just use the option “Skip pages or posts” under the tab “Exceptions”.

For a more custom approach use the action wpel_apply_settings:
add_action( ‘wpel_apply_settings’, function () {
global $post;
$ignored_post_ids = array( 1, 2, 4 );

    if ( in_array( $post->ID, $ignored_post_ids ) ) {
        return false;
    }

    return true;
}, 10 );

Using this filter you can ignore any request, like certain category, archive etcetera.

I want specific links to be ignored by the plugin. How?

There’s an option for ignoring links containing a certain class (under tab “Exceptions”).

For a more flexible check on ignoring links you could use the filter wpel_before_apply_link:
add_action( ‘wpel_before_apply_link’, function ( $link ) {
// ignore links with class “some-cls”
if ( $link->has_attr_value( ‘class’, ‘some-cls’ ) ) {
$link->set_ignore();
}
}, 10 );

How to create a redirect for external links? (f.e. affiliate links)

Create redirect by using the wpel_link action. Add some code to functions.php of your theme, like:

add_action( 'wpel_link', function ( $link ) {
    // check if link is an external links
    if ( $link->is_external() ) {
        // get current url
        $url = $link->get_attr( 'href' );

        // set redirect url
        $redirect_url = '//somedom.com?url='. urlencode( $url );
        $link->set_attr( 'href', $redirect_url );
    }
}, 10, 1 );

How to open external links in a new popup window?

Wow, this plugin is so powerful! I love how it integrates several related features into one utility:

nofollow
external link override
internal link exclusion
exception links
external/internal link icon options built-in!

Great work!

Leave a Reply

Your email address will not be published. Required fields are marked *