Version Description
- First released version.
- Please send me your feedback.
=
Download this release
Release Info
Developer | cybernetikz |
Plugin | Nofollow for external link |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- nofollow-external-link.php +53 -0
- readme.txt +75 -0
- screenshot-1.png +0 -0
nofollow-external-link.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Nofollow for external link
|
4 |
+
Plugin URI: http://www.cybernetikz.com
|
5 |
+
Description: Just simple, if you use this plugins, `rel="nofollow"` and `target="_blank"` will be added automatically, for all the external links of your website posts or pages.
|
6 |
+
Version: 1.0
|
7 |
+
Author: CyberNetikz
|
8 |
+
Author URI: http://www.cybernetikz.com
|
9 |
+
License: GPL2
|
10 |
+
*/
|
11 |
+
|
12 |
+
add_filter( 'the_content', 'cn_nf_url_parse');
|
13 |
+
|
14 |
+
function cn_nf_url_parse( $content ) {
|
15 |
+
|
16 |
+
$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>";
|
17 |
+
if(preg_match_all("/$regexp/siU", $content, $matches, PREG_SET_ORDER)) {
|
18 |
+
if( !empty($matches) ) {
|
19 |
+
|
20 |
+
$srcUrl = get_option('home');
|
21 |
+
for ($i=0; $i < count($matches); $i++)
|
22 |
+
{
|
23 |
+
|
24 |
+
$tag = $matches[$i][0];
|
25 |
+
$tag2 = $matches[$i][0];
|
26 |
+
$url = $matches[$i][0];
|
27 |
+
|
28 |
+
$noFollow = '';
|
29 |
+
|
30 |
+
$pattern = '/target\s*=\s*"\s*_blank\s*"/';
|
31 |
+
preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);
|
32 |
+
if( count($match) < 1 )
|
33 |
+
$noFollow .= ' target="_blank" ';
|
34 |
+
|
35 |
+
$pattern = '/rel\s*=\s*"\s*[n|d]ofollow\s*"/';
|
36 |
+
preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);
|
37 |
+
if( count($match) < 1 )
|
38 |
+
$noFollow .= ' rel="nofollow" ';
|
39 |
+
|
40 |
+
$pos = strpos($url,$srcUrl);
|
41 |
+
if ($pos === false) {
|
42 |
+
$tag = rtrim ($tag,'>');
|
43 |
+
$tag .= $noFollow.'>';
|
44 |
+
$content = str_replace($tag2,$tag,$content);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
$content = str_replace(']]>', ']]>', $content);
|
51 |
+
return $content;
|
52 |
+
|
53 |
+
}
|
readme.txt
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Nofollow for external link ===
|
2 |
+
Plugin URI: http://www.cybernetikz.com
|
3 |
+
Contributors: cybernetikz
|
4 |
+
Donate link:
|
5 |
+
Tags: nofollow,link,rel,rel nofollow,seo,nofollow links,external link,external links,nofollow for external link
|
6 |
+
Requires at least: 2.9.2
|
7 |
+
Tested up to: 4.2.2
|
8 |
+
Stable tag: 1.0
|
9 |
+
License: GPL2
|
10 |
+
|
11 |
+
Automatically insert `rel=nofollow` and `target=_blank` to all the external links into your website posts or pages.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
Just simple, if you use this plugins, `rel=nofollow` and `target=_blank` will be insert automatically, for all the external links of your website posts or pages.
|
16 |
+
|
17 |
+
> <strong>PAID SUPPORT ($30/Hr, We ACCEPT PAYPAL )</strong>
|
18 |
+
>
|
19 |
+
> We assume most of the users would find it easy to install & use this plugin but those who needs support on any of the following:
|
20 |
+
>
|
21 |
+
> <strong>a. Get the plugin installed </strong>
|
22 |
+
>
|
23 |
+
> <strong>b. Custom feature, custom theme </strong>
|
24 |
+
>
|
25 |
+
> <strong>c. Auditing your wordpress theme & hosting environment</strong>
|
26 |
+
>
|
27 |
+
> <strong>d. Google analytics & webmaster tools support</strong>
|
28 |
+
>
|
29 |
+
> please send an email to this address <a href="mailto:support@cybernetikz.com">support@cybernetikz.com</a>
|
30 |
+
|
31 |
+
= Feature =
|
32 |
+
* Add `rel=nofollow` for all the external link of your blog/website posts/pages.
|
33 |
+
* Add `target=_blank` for all the external link of your blog/website posts/pages.
|
34 |
+
* This plugins will not add `rel=nofollow` and `target=_blank` any of the internal link of your blog/website posts/pages.
|
35 |
+
* If you already added `rel=dofollow` to any post manually, this plugins will not add `rel=nofollow` for that post.
|
36 |
+
* If you already added `target=_blank` to any post manually, this plugins will not add `target=_blank` for that post.
|
37 |
+
|
38 |
+
You can visit our website <a href="http://www.cybernetikz.com/blog/wordpress-plugins-external-links-relnofollow/">cybernetikz.com</a>
|
39 |
+
|
40 |
+
Wating for your valuable feedback/comments.
|
41 |
+
|
42 |
+
== Installation ==
|
43 |
+
|
44 |
+
1. Download the latest zip file and extract the 'nofollow-external-link' directory.
|
45 |
+
2. Upload it to your '/wp-content/plugins/' directory.
|
46 |
+
3. Activate 'Nofollow for external link' on the 'Plugins' menu in WordPress.
|
47 |
+
4. That's it, you are all done :)
|
48 |
+
|
49 |
+
== Frequently Asked Questions ==
|
50 |
+
Not yet
|
51 |
+
Please send me your feedback. Thanks.
|
52 |
+
|
53 |
+
== Screenshots ==
|
54 |
+
|
55 |
+
1. see how the `rel=nofollow` inserted to all the external links
|
56 |
+
|
57 |
+
== Changelog ==
|
58 |
+
= 1.0 =
|
59 |
+
* First released version.
|
60 |
+
* Please send me your feedback.
|
61 |
+
|
62 |
+
== Upgrade Notice ==
|
63 |
+
* First released version.
|
64 |
+
|
65 |
+
== Readme Generator ==
|
66 |
+
* This plugin's readme.txt file was generated by the [WikiDuh Readme Generator](http://wikiduh.com/project/readme-gen) for WordPress Plugins.
|
67 |
+
|
68 |
+
== Support ==
|
69 |
+
|
70 |
+
* [Plugin Homepage](http://www.cybernetikz.com)
|
71 |
+
* [admin@cybernetikz.com](mailto:admin@cybernetikz.com)
|
72 |
+
|
73 |
+
== Donations ==
|
74 |
+
|
75 |
+
Thanks for using this plugins
|
screenshot-1.png
ADDED
Binary file
|