Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Installing & running WordPress (http://forum.bytesforall.com/forumdisplay.php?f=6)
-   -   Getting rid of the rel="nofollow" thing in articles (not comments), how? (http://forum.bytesforall.com/showthread.php?t=2143)

MarkusM. Jun 22, 2009 01:05 PM

Getting rid of the rel="nofollow" thing in articles (not comments), how?
 
Hi there,

The whole evening I'm searching and trying different plugins in order to get rid of the automatically inserted nofollow-thingy in WP.
I tried "nofollow case by case", "dofollow" and "follow URL".

But none of the plugins workes in the way I need. I need to remove the tag from links in articles.
That the tags are automatically removed in comments, that may be ok for the first time.

Do anyone of you know a plugin that removes the nofollow-tag out of written articles ?

Thanks in advance,
Markus

Flynn Jun 22, 2009 03:48 PM

You shouldn't have rel=nofollow in post content. A plugin might be causing this

But regardless, the following code would remove rel=nofollow from all post content. Add it at the bottom of functions.php, before the last closing ?> tag:

PHP Code:

add_filter("the_content""remove_nofollow");
function 
remove_nofollow($string) {
    
$string str_ireplace(' rel="nofollow"'''$string);
    return 
$string;


To remove rel=nofollow from comment text as well, also add:

PHP Code:

add_filter("comment_text""remove_nofollow"); 


MarkusM. Jun 23, 2009 01:05 AM

Hi Flynn, thanks for your reply.
I set up a new WP installation for testing reasons with the same effekt.
New installation, new database, no plugins, nothing.
But rel=nofollow is coming up as default in the article content :(

Now I'm trying your code-appendix. Thanks for that.
But none of the files, I tried the code with, worked.
I tried your piece in :
- wp-includes/functions.php
- wp-content/themes/classic/functions.php
- wp-content/themes/default/functions.php

When I inserted your code in the first mentioned functions, I'm only getting a white page, in the other cases nothing happens (site appears, but with nofollow acitvated).

Regards
Markus

Flynn Jun 23, 2009 06:30 PM

You should put it into Atahualpa's functions.php

fromtheranks Jun 26, 2009 01:35 PM

Hi,

As an add-on to Flynn's remarks (and I'm not aware of WP setting "nofollow" as a default either), there are a couple of SEO plugins that will allow you to control the follow / nofollow status of posts and pages.

I am using, and learning, HeadSpace2 which, among other things, allows you to set up a default for posts and pages at a global level (ex: you can set nofollow for category and archive pages) but with the ability to do overrides on an individual post or page.

Another is All In One SEO, which is simpler to work with but doesn't have the granularity of control (which might not be a bad thing as HS2 has a fairly steep learning curve).

Hope this helps.

kboode Apr 25, 2010 10:20 AM

I have been using a plugin to remove the nofollow tag from my comments section for quite a while. I believe that it has worked in the past.
Today I checked again and to my surprise all comments have the rel=nofollow tag. This despite the plugin. I downloaded a few other plugins with similar workings to the one I had been using, but the nofollow continues to show.
Then I searched in the forum here and found this thread. I added the suggested lines of code to functions. php with the Atahualpa theme, but no matter what I do the no follow remains.
Is this an issue with the latest wordpress version? Or am I doing something wrong?

I am using wordpress 2.9.2., atahualpa 3.4, my comment system is Disqus and my blog is at http://automarker.net/blog/

juggledad Apr 25, 2010 04:06 PM

have you checked to see if Disqus is adding that in?


All times are GMT -6. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.