Is there anyway to add the nofollow tag to links?
bbPress support forums » Troubleshooting
Add nofollow to links
(18 posts)-
Posted 1 year ago #
-
I would imagine that you could do this without affecting any core files through a plugin as the links portion for posts is pluggable. Now, saying that, we need someone with some experience working with the code to make this a plugin.
Trent
Posted 1 year ago # -
Please--can you tell me specifically where to add this? What file and which lines? (Sorry, perpetual noob, trying to learn.) :-)
Posted 8 months ago # -
You can simply add that line into
bb-includes/default-filters.php
or
create your own plugin file with that line.Posted 8 months ago # -
livibetter, for us noobs, can you show what a plugin would look like with just that functionality, so we could avoid modifying a core file in bb-includes?
Thanks.
Posted 8 months ago # -
Here it is:
<?php /* Plugin Name: My own tweak for my forums Plugin URI: http://bbpress.org/ Description: Fine tuning codes for my forum Author: Your name Author URI: http://www.myforum.com/ Version: 0.1 */ add_filter('post_author_link', 'bb_rel_nofollow'); ?>Basically, you can put many fine tuning codes within one PHP files, and this file is for your forum only. Remember to activate this plugin.
Posted 8 months ago # -
If it were a _plugin, would it load automatically, and not require activation? Like, you could call it _myforumtweaks.php and it would be loaded automatically with no activation once you dropped it into my-plugins?
That's all there is to a simple add_filter plugin, eh? (no video required...)
Posted 8 months ago # -
livibetter,
Thanks so much! It works beautifully.
I know it works on new posts, on URLs in the post.
Does it also work on URLS in old posts, when they're viewed? I am not able to test that.
Also, it obviously doesn't work on author's website links (the ones saves in their user profile, I mean). How do we make those nofollow if we want to?
Many, many thanks. I am learning, but slowly.
Posted 8 months ago # -
Okay, upon further testing, it does seem to be working with older posts--in certain circumstances.
Let me explain
If you simply type (or in the past typed) in a URL, this plugin adds "nofollow." But if you write a sentence and add a link to the text, it doesn't. You can see this in effect here:
http://bedbugger.com/forum/topic/test-5?replies=3#post-14812Compare the two tests of a link to google. The first, where the URL is typed in, adds nofollow, the second, where the HTML is used to link out to google, doesn't.
Please help me fix this? Thanks again, this is a huge help!
Posted 8 months ago # -
It works great.. but a savvy spammer can bypass this simply by editing their post and adding rel='follow' to their a tag.. anyone know of a more complete/thorough solution?
Posted 5 months ago # -
It worked fine with me, I'll just manually delete the entry of the spammers! :)
Posted 5 months ago # -
Try manually deleting a few hundred posts per day once you get popular..?
Anyone know of more thorough solution? One that permanently adds "nofollow" to all posted links??
Posted 4 months ago # -
I thought this plugin did that?
http://bbpress.org/forums/topic/add-nofollow-to-links#post-12523Posted 4 months ago # -
Hi there,
I have tried so hard to tweak this plug in but I am unable. All I want is to add besides the nofollow is a target="_top" so that the forum user is able to go out to another window for external links.
Can anyone help me please,
Many thanks,
Posted 1 month ago # -
by default the nofollow is there, but how can we add some more things to the tag?
Posted 1 month ago # -
cordoval, make this into a plugin:
//add target=_blank to post links function bb_target_blank( $text ) { $text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text); return $text; } add_filter('pre_post', 'bb_target_blank');Posted 1 month ago # -
the problem was that it was not 'post_author_link but 'post_text
Posted 1 month ago #
Reply
You must log in to post.