Notifications
Clear all

wpForo 1.x.x [Closed] How to add the atribute Nofollow+noopener+noreferer to the external links?

15 Posts
6 Users
1 Reactions
1,856 Views
Posts: 47
Topic starter
(@ferreidea)
Trusted Member
Joined: 5 years ago

Hi!

Is possible to implement the attribute Nofollow+noopener+noreferer to the external links in wpforo to avoid any linkjuice to pass to external websites and this way avoid SEO's Spamming?

 

Kind regards

14 Replies
Alvina
Posts: 1867
Moderator
(@alvina)
Member
Joined: 5 years ago

Hi @ferreidea,

Sorry for the late response.

wpForo add nofollow to all external links automatically. 

4 Replies
(@ferreidea)
Joined: 5 years ago

Trusted Member
Posts: 47

@alvina we know that and is good, but we want to add the Nofollow+noopener+noreferer atribute such other forums does.

This type of atrubute do not transfer any authority to the external linking site... so this way we can avoid SPAM on our forum site of SEO's trying to gain authority to their sites by puting the link in ours..

 

Please see the atatched screenshot to undertand better what we are talking about.

 

Kind regards

Alvina
Moderator
(@alvina)
Joined: 5 years ago

Member
Posts: 1867

@ferreidea,

I'm sorry but wpForo doesn't have such a functionality.

(@manuo84)
Joined: 3 years ago

New Member
Posts: 3

@alvina I am sorry but this is not true. As you can see in the code (see attached file). So how to set all internal links as "nofollow" ?

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@manuo84,

I don't recommend you to make all your internal link to nofollow.

Please read the post below: https://searchengineland.com/stop-think-twice-using-nofollow-attributes-website-294133

Posts: 3
(@manuo84)
New Member
Joined: 3 years ago

Hi, I know but I am not talking about internal links.

Where is the option to make the links from my wpforo forum pointing to an external website as no follow ?

Chris
Posts: 3650
(@chris)
Famed Member
Joined: 3 years ago
@manuo84,
 
Posted by: @manuo84

So how to set all internal links as "nofollow" ?

This is what you wrote above.

 

Posted by: @manuo84

Where is the option to make the links from my wpforo forum pointing to an external website as no follow ?

wpForo adds nofollow to all external links automatically.

Also, you can choose nofollow or dofollow by the link button, which inserts a URL to the Word/Sentence. Before submitting the post, if you let the Open Link In New Tab Checkbox selected, wpForo system will choose "rel" attribute by the link type.

Posts: 3
(@manuo84)
New Member
Joined: 3 years ago
Posted by: @chris

This is what you wrote above.

@chris Yes my bad : I would like to say external links.

Posted by: @chris

wpForo adds nofollow to all external links automatically.

I am sorry but this is not true. As you can see in the source code (see attached file).

Posted by: @chris

Also, you can choose nofollow or dofollow by the link button, which inserts a URL to the Word/Sentence. Before submitting the post, if you let the Open Link In New Tab Checkbox selected, wpForo system will choose "rel" attribute by the link type.

I don't see any option about "no follow". You are talking about the "no opener" wich is not what I am talking about.

-------------

The problem is :

As a SEO guy, I don't want to give free backlinks trough my wpforo forum.

Why don't you put an option to set all external links from the forum as no follow ?

This is an important feature which is missing.

 

Thank you for your reply.

5 Replies
Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@manuo84,

Insert the below code in wp-content/plugins/wpforo/wpf-includes/functions.php

Find

function wpforo_nofollow(

and replace the content of the code with the below code(the content start with {  )

{
   $ret = $match[0];
   if( apply_filters( 'wpforo_external_link_nofollow', true ) ){
      $dofollow          = array_filter( array_map( "trim", explode( "\n", WPF()->tools_misc['dofollow'] ) ) );
      $request_uri_parse = parse_url( wpforo_get_request_uri() );
      $main_host         = preg_replace( '#^.*?([^\.]+?\.[^\.]+?)$#isu', '$1', $request_uri_parse['host'] );
      $link_url          = parse_url( $match[1] );
        if( strpos($match[1], $main_host) === false && !(!empty($dofollow) && !empty($link_url['host']) && in_array($link_url['host'], $dofollow)) ){
           $ret = preg_replace_callback(
                '#\srel=[\'\"]([^\'\"]*?)[\'\"]#iu',
                function($m){
                    $rels = array_filter( preg_split('#\s#u', $m[1]) );
                    $rels = array_merge( array('nofollow'), $rels );
                    return sprintf('rel="%1$s"', implode(' ', $rels));
                },
              $match[0],
                1,
                $count
            );
            if( !$count ) $ret = str_replace('>', ' rel="nofollow">', $match[0]);
        }
    }
    return $ret;
}

 

AlShoker
(@alshoker)
Joined: 3 years ago

Eminent Member
Posts: 25

@chris, Perhaps the problem with nofollow is due to a bug in the Visual Editor? Look at the screenshots, please.
Depending on how the user places the link, a nofollow attribute is attached to the link or not.
If you just insert a link into the comment input window, then it is obtained with nofollow, but without noopener. And if you insert a link through a button in the Visual Editor, then the link is obtained without nofollow, but with noopener. This can be seen in 2 screenshots.
How can I fix the Visual Editor function so that all outgoing links are nofollow and noopener without fixing the /wpf-includes/functions.php file?

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@alshoker,

No matter you are using Visual Editor Or Text Edit, if you don't want to make changes on functions.php file, you can wait for wpForo 2.0 version, i n the new version all external links are with noopener and nofollow.

AlShoker
(@alshoker)
Joined: 3 years ago

Eminent Member
Posts: 25

@chris Great news! When can we expect version 2.0 approximately?

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3650

@alshoker,

No ETA yest but it will be available in FH of 2022

Page 1 / 2