Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

MyBB - Add NOFOLLOW to All User Links

Ads
banner
banner
banner
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#1
Support Team
By default MyBB forum script doesn't add rel="nofollow" to outgoing links neither to user homepage (postbit and profile), MyBB only allows you to add rel="nofollow" to the signature and it only affects signature in postbit not the signature in the profile.

rel="nofollow" is very important in SEO because first it keeps the search engine crawlers from leaving your page once they stumble upon an outgoing link and second it tells search engine that the link is not to be used for PagaRank thus saving your PageRank which is very important!

There are a few plugins that add nofollow to homepage, www button and even to all the outgoing links however they are not perfect and sometimes under certain circumstances they don't work like for instance http:// and https:// will crash most of them then if you add URLs this way with the comma at the end "URL1, URL2, URL3" most will only add rel="nofollow" to the last one which is URL3 as you can see those plugins are full of bugs so I don't recommend using plugins to add rel="nofollow" but only to remove it!!!!!

So lets get started.

First is first lets add rel="nofollow" to most of the outgoing links, this will add rel="nofollow" to all the outgoing links except www button and profile homepage!

./inc open parser.php file and inside the file find:

PHP Code:
$link "<a href=&#092;"$fullurl&#092;" target=&#092;"_blank&#092;"{$nofollow}>$name</a>"


Add replace it with this one:

PHP Code:
$link "<a rel=&#092;"nofollow&#092;" href=&#092;"$fullurl&#092;" target=&#092;"_blank&#092;"{$nofollow}>$name</a>"


Not lets add rel="nofollow" to www button!

Log into your admin control panel and go to:

Templates & Style>>Templates>>your templates>>Post Bit Templates>>postbit_www

Replace this code:

PHP Code:
<a href="{$post['website']}target="_blank"><img src="{$theme['imglangdir']}/postbit_www.gif" alt="{$lang->postbit_website}title="{$lang->postbit_website}/></a

With this one:

PHP Code:
<a rel="nofollow" href="{$post['website']}target="_blank"><img src="{$theme['imglangdir']}/postbit_www.gif" alt="{$lang->postbit_website}title="{$lang->postbit_website}/></a

Now lets add rel="nofollow" to user homepage which shows in the profile!

Open member.php file and inside the file find this code:

PHP Code:
$website "<a href=&#092;"{$memprofile['website']}&#092;" target=&#092;"_blank&#092;">{$memprofile['website']}</a>"

Now replace it with this one:

PHP Code:
$website "<a rel=&#092;"nofollow&#092;" href=&#092;"{$memprofile['website']}&#092;" target=&#092;"_blank&#092;">{$memprofile['website']}</a>"

Don't forget to enable rel="nofollow" for the signature in ACP>>User & Groups>>Groups>>your group>>Users and Permissions>>Signature links have nofollow enabled?

That's pretty much it except the fact that rel="nofollow" will be added to all the internal and external links in the postbit so we need to install a very simple plugin that will remove rel="nofollow" from the internal links.

Save this file as nofollowlink.php and upload it into plugins directory then activate it from admin control panel!

PHP Code:
<?php
if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("parse_message_end""nofollowlink_changelink");

function 
nofollowlink_info()
    {

    return array(
        
"name"        => "Removes Nofollow from Internal links",
        
"description"        => "A simple plugin that removes nofollow from your internal links",
        
"website"        => "http://letsforum.com",
        
"author"        => "Victor Dub",
        
"authorsite"        => "http://letsforum.com",
        
"version"        => "1.0",
        
"guid"             => "0fead3ffd1a376ceb5cef3388df5d39d",
        
"compatibility"    => "*"
        
);
    }

        function 
nofollowlink_changelink($message){
        global 
$mybb;
        
$my_site $mybb->settings['bburl'];
        
$search '<a rel="nofollow" href="'.$my_site.'';
        
$replace '<a href="'.$my_site.'';
     
$message str_replace($search  $replace  $message);
     return 
$message;
        }
?>
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

#2
Posting Freak
If your are serious about SEO then you have to add nofollow to all links that are not part of your site! You can spend endless amount of time posting good content generating backlinks but if you fail to do this then you will never improve your rankings and PageRank. This is a must do SEO article!
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#3
Junior Member
Hi marcus_avrelius,
I have a question, what's happen if I using this tutorial with Google SEO plugin, because Google SEO plugin have added Nofollow links: "Nofollow links:
Give recently posted links the Nofollow attribute. If your forum gets spammed, this will give you time to moderate, while still giving reputation to outgoing links in the long run. The default value is 7.0 days (one week). Set to 0 to disable, or -1 for infinite duration (not recommended)."
But I want to add rel = "dofollow" for all links which post by specification users(Like: administrator, mod or some user of mine)? How can I do that?

Many thanks in advance! Sorry for my bad english.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#4
Support Team
Hi don't wary your English is perfect.

SEO plugin is a great plugin but it's not perfect and the problem is that it adds nofollow to all links internal and external which is not good for SEO we need to only add nofollow to outgoing links and leave internal links dofollow to allow Google crawl and index our site content thus increasing PageRank and search engine rankings.

The other problem with SEO plugin is that it only adds nofollow for a certain period of time after which links become do follow spammers know that, we need to keep outgoing links nofollow forever if we care about SEO!
victor Offline referral

Posts: 638
Joined: Jun 2013
Reputation: 33

#5
Senior Member
If you add nofollow to internal links (your forum links) then Google will not follow them (follow means Google will index that URL) and if your content doesn't get indexed then your SEO will be affected in a negative way you will never rank high on Google!
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#6
Junior Member
Hi victor, marcus_avrelius,
Yes, it does what you said. But in my case, how can I custom it? I mean that I want to make some users(Like: administrators, mods or a group or someone) who can post an articles with dofollow links?
Tks Smile
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#7
Senior Member
If you allow members to post dofollow links then you will be loosing rankings this is no go for SEO!
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#8
Junior Member
Hi ivan,
I mean that all members who can post dofollow links are of mine, I create those members because I have a forum and a blog, sometime I want to exchange links between my blog and my forum.
Nice day!
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#9
Senior Member
Then you can just add a conditional function that will search for specific URL's and remove nofollow from them!
This plugin only removes nofollow from your domain so PM Marcus domain names you want to strip nofollow from!
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#10
Junior Member
Hi ivan,
Thank you very much!
Hi marcus_avrelius,
Would you show me how to add a conditional function that will search for specific URL's and remove nofollow from them? I think when this plugin can do that, it will be perfectly!
Thanks.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#11
Support Team
PHP Code:
$message str_replace($search  $replace  $message); 
Above this code add conditional you see bellow:


PHP Code:
//Allowed URLs
$allowed_url_1 "URL GOES HERE";
$search_1 '<a rel="nofollow" href="http://'.$allowed_url_1.'';
$replace_1 '<a href="http://'.$allowed_url_1.'';
$message str_replace($search_1$replace_1$message); 

Repeat this for every URL. Just change $search_1 to $search_2 and $allowed_url_1 to $allowed_url_2

Or you can simply add new PHP function for each URL:

PHP Code:
function nofollowlink_changelink_allowed_1($message){
            
$search '<a rel="nofollow" href="http://letsforum.com';
$replace '<a href="http://letsforum.com';
$message str_replace($search  $replace  $message);
     
return 
$message;


Add this code and each new one after the last } symbol. Remember to change domain name!

Remember to change the name for each new function!
nofollowlink_changelink_allowed_1 to nofollowlink_changelink_allowed_2 and so on!
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#12
Junior Member
Hi marcus_avrelius,
It means that I have to create a function for each URL?
When I do that, this plugin will work with no problem? Because those functions are the same.
Can I using only one function? I mean that we can using a array to add 1 and more than 1 site which is allowed.
Otherwise, we can using:

PHP Code:
$my_site1 $mybb->settings['bburl'];
$search1 '<a rel="nofollow" href="'.$my_site.'';
$replace1 '<a href="'.$my_site.'';

$my_site2 "URL GO HERE"
$search2 '<a rel="nofollow" href="'.$my_site2.'';
$replace2 '<a href="'.$my_site2.'';

...

If((
$my_site $my_site1)
{
         
$message str_replace($search1  $replace1  $message);
return 
$message;
}elseif(
$my_site $my_site2)
{
         
$message str_replace($search2  $replace2  $message);
return 
$message;


I don't know about programming, but a bit. I wonder this command will replace all?
Maybe I'm getting greedy. But I want this plugin will be perfectly Big Grin
In ACP, I want to add a function that administrator can delelte, add, edit URL which is allowed dofollow.
Thank you very much!



Thanks
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#13
Support Team
Hi I am sorry but I am still learning PHP codding! Lets just create a database setting for it where we will store our URLs. I am not positive it's bug free so if you have more knowledge than me please feel free to edit it!

PHP Code:
function nofollowlink_changelink_activate()
{
    global 
$mybb$db;
    
    
    
$query $db->simple_select("settinggroups""gid""name='posting'");
    
$gid $db->fetch_field($query"gid");

    
$setting_1 = array(
        
"name"            => "followlinks",
        
"title"            => "Dofollow Links",
        
"description"    => "These are URLs that will become dofollow. Separate each one with a comma.",
        
"optionscode"    => "text",
        
"value"            => "http://letsforum.com",
        
"disporder"        => "25",
        
"gid"            => $gid,
    );
    
        
$db->insert_query("settings"$setting_1);
        
rebuild_settings();

}

function 
nofollowlink_changelink_deactivate()
{
    global 
$mybb$db;
    
    
$db->delete_query("settings","name='followlinks'");
    
    
rebuild_settings();




And you can use this function.

PHP Code:
$nofollowlink_changelink explode(","$mybb->settings['followlinks']);
    
    foreach(
$followlinks as $followlink)
    {

        if(
preg_match("/$followlink/"$message$match))
        {
    
            
//Do something

        
}
    } 
eosdttve Offline referral

Posts: 6
Joined: Mar 2014
Reputation: 0

#14
Junior Member
I am too, I am beginer at PHP. Thank you again
seo123 Offline referral

Posts: 427
Joined: Mar 2014
Reputation: 16

#15
Senior Member
You should add no follow to all links that are not useful to SEO including internal links!
yavar99 Offline referral

Posts: 4
Joined: Jun 2014
Reputation: 0

#16
Junior Member
Hi friends
Thank you for good training
but, I can not find the parser file in the inc folder.
please, help me.
thank you.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#17
Support Team
Hi the file you are talking about is called: class_parser





User(s) browsing this thread: 1 Guest(s)