wordpress插件之External Links – nofollow, noopener & new window

External Links – nofollow, noopener & new window的作者是WebFactory Ltd,目前有60,000+个有效安装。已经Tested with 5.4.1版本的wordpress。
Description

Manage all external & internal links on your site. Control icons, nofollow, noopener, ugc (User Generated Content), sponsored and if links open in new window or new tab.

WP External Links plugin was completely rebuilt in v2 and has lots of new features, like noopener, ugc and sponsored values for rel; font icons, internal links options and full WPMU support.

FEATURES
Manage external and internal links
Open links in new window or tab
Add follow or nofollow (for SEO)
Add noopener and noreferrer (for security)
Add ugc (User Generated Content) and sponsored values to rel (Google announcement)
Add link icons (FontAwesome and 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.

Like the plugin? Rate it to support the development.

文档

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:

Go to somedomain

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.

微慕商城——精选wordpress插件及wordpress主题,帮助站长快速生成wordpress小程序。
微慕WordPress小程序商城 » wordpress插件之External Links – nofollow, noopener & new window

提供最优质的资源集合

立即查看 了解详情