Skip to main content
Request - Nofollow attribute for external links Started by radu81 · · Read 39841 times 0 Members and 3 Guests are viewing this topic. previous topic - next topic

Request - Nofollow attribute for external links

Hello,

I would like to set all my external links with "nofollow" attribute and the possibility to set which membergroups can add links without nofollow attribute. Is this difficult to code? There is nothing similar for SMF

In other forums nofollow to external links is enabled from default (wbb and XF)
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #1

Arghh!!

I wanted to answer sooner, but I left it open on the other computer... :-[

It shouldn't be that difficult, just a search&replace of the current url bbcode implementation.
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #2

I know we talked about doing this at least to signature / profile links by default.

Not sure about having it permission based so that some members links have nofollow and others don't ... could be done in parse bbc based on the post author id ... does XF do that?

Re: Request - Nofollow attribute for external links

Reply #3

In Xenforo and WBB all external links are nofollow, messages and signatures. In xf you can use an addon to remove the nofollow attribute for some groups, don't know in WBB or other forums
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #4

Quote from: Spuds – I know we talked about doing this at least to signature / profile links by default.

Not sure about having it permission based so that some members links have nofollow and others don't ... could be done in parse bbc based on the post author id ... does XF do that?
You'd need to get the permissions of the author. You'd want to do that before parse_bbc() to do a single query / cache request. A lot of work for something like this. Not sure anyone would want to make their site slower for nofollow on links.

Re: Request - Nofollow attribute for external links

Reply #5

I understand it's not an easy task, but is possible to set all external links as nofollow and those I want to set without nofollow to insert manually using html code? I know is not the best solution, but I only need to set a few links without nofollow attribute
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #6

Quote from: radu81 – In xf you can use an addon to remove the nofollow attribute for some groups,
Just because I'm very unfamiliar with XF: does that mean the group can be made allowed to post "follow" links?
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #7

you can find all info here https://goo.gl/41cYkI
from default in XF only admins and moderators can post links bypassing the nofollow attribute, with that addon other membergroups may bypass the nofollow attribute. No "dofollow" attribute is added, only nofollow  attribute is removed
Screenshot from this addon:



Why I am asking this?
I sell a couple of banners and a couple of promotional article into my forum, not a big ammount but it covers a good part of my vps costs. Last year I received a good price even if my forum was less visited than it is now, this year the forum is almost 3 times bigger (users, topics, and number of visits in analytics). The offer I had this year is half than the precedent one because I have lots of external links. Here is the answer I received:

QuoteWell, our formula is mostly about the amount of domains linking to your website via direct and dofollow links. After that we consider "spam flags" from moz.com. Data from moz.com wasn't considered before, but now it affects budgets significantly, mostly due to the "Large Number of External Links" flag for sharkracingclub.it/ and skodaclub.it/. You can check this via this links https://moz.com/researchtools/ose/spam-analysis/flags?subdomain=www.skodaclub.it. So we don't even know the number of clicks/views and they are not being considered at all.

Since a similar addon will make me gain something I think this addon should be asked as paid.
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #8

XF's BBC parser is very different (and better in most ways). It saves the post as a tree and then parses that. This allows it to do a lot of things that we can't a lot easier. I think it's slightly slower but not by much. Though, looking at what you posted, it seems it's not concerned with when viewing but only when posting.

So, a user could post without the permission and then later have it but the links don't change. Same with vice versa. I think this is pretty easy to do in the preparser even before 1.1's updated parser.

Are you saying you're willing to pay for it? If so, I can try to find some time to do it. I am looking for a job right now and moving so taking time to do something without getting paid is not really possible right now (also why I stopped developing recently).

Re: Request - Nofollow attribute for external links

Reply #9

Well, what I have in mind to do about that is (ab)use preparse code as usual: if you are allowed, you go, otherwise the nofollow is added as a parameter to url and that's all.
This approach has a couple of drawbacks of course:
1) removing or disabling the addon will destroy the links (restoring will need a maintenance task),
2) the editor bbc will require some adjustment because otherwise it may not recognize properly the new url.
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #10

I didn't test it much, it should work, but I'd test it on a test site, not live. O:-)

ETA: attachment removed.
Last Edit: March 06, 2016, 05:24:15 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #11

Since I see one download I'll post it there so that its an "update". :P

The one attached here includes the replacement of the editor code, so that the new schema is recognized by the editor as well. :)

ETA: forgot to mention, it has also the permission.

ETA2: I forgot to mention another important thing, any old link is set as "nofollow", so if you have old links that should not be "nofollow", you have to edit the message and restore the "normal" url bbcode.

ETA: attach removed.
Last Edit: March 08, 2016, 03:28:06 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #12

Sorry for the delay and thanks for watching into this. I tested the addon in localhost, but it was an imported smf so I choosed to start from a clean install.

http://sharkracingclub.it/elktest/index.php?topic=1
Here is what I did:
- created 2 users,
    - user "biguser" is in the group "nofollow" where I set the permission to post nofollow links
    - "user" is a regular user with ElkArte default permission

I tried to edit as admin my post and look the result http://sharkracingclub.it/elktest/index.php?topic=1.msg2#msg2

The text I wanted to insert is:
Code: [Select]
copy/pasted link: 

www.google.com

link inserted with url:

[url=http://www.google.com]Google[/url]

As I can see all links are nofollow and it breaks link for the special group and also for the admin.

if you want to test, both users are using the pass 123456
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #13

I know part of that one! :D
I changed the code for a reason, but now I don't remember exactly what was the reason any more... :-[
So... let's just assume I was not in the right state of mind the other day and the one attached here is the correct package. O:-)

ETA: attachment removed.
Last Edit: March 08, 2016, 04:04:11 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #14

I confirm that links are not broken with this release, but I still see all links as nofollow, no matter if is a post from admin or from a user in the special group
sorry for my bad english