• [moved to “Fixing WordPress”]

    Hi everyone,

    I have searched via Google the whole afternoon (now is 8pm here!) and found nothing suitable. Unbelievable, tell me! One would think there must be millions who required to TURN OFF the automatic addition of “rel=nofollow” in wp comments.

    But no, all Google finds is: plugins to always follow, to always unfollow, to choose when to follow/unfollow, etc etc.

    Phew! That’s not suitable. We simply need to do sth like this
    add_filter(‘comment_text’, ‘auto_nofollow’);

    but that doesn’t work. ??

    ——-
    In brief WHY wp’s automatic addition and thus robbing webmasters’ freedom is ill thought through:
    – We do not pass comments with links ANYWAY (end in spam)
    – But we do reply to comments/questions with helpful links mostly within our own site (is a huge knowledge base)
    – Now, it makes NO SENSE whatsoever that **in such case** wp adds “nofollow”, you see my point?

    We do not want more plugins (doesn’t make sense anyway), we simply require to UNDO what wp seems to do automatically to our comments (our own comments, in this case). Okay?

    Anyone found out how to “hack” (is that necessary??) wp to NOT add nofollows?

    We are perfectly capable of adding nofollow ourselves where WE feel it’s helpful. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @cooldavidoff,

    Try the following in your functions.php

    
    function commentdofollow($text) {
    return str_replace('" rel="nofollow">', '">', $text);}
    add_filter('comment_text', 'commentdofollow');
    remove_filter('pre_comment_content', 'wp_rel_nofollow', 15);
    function remove_nofollow($string){
    return str_ireplace(' nofollow', '', $string);}
    add_filter('get_comment_author_link', 'remove_nofollow');

    Hope this helps.

    SYA ??
    LebCit

    Thread Starter CoolDavidoff

    (@cooldavidoff)

    Thanks LebCit for replying. No that doesn’t help, it does what the dofollow plugins do (first in my list above), ie it deletes all nofollows.

    As said, we don’t need nor want to delete all nofollows, but instead to NOT have wp mess up linking on our site at all.

    Ie when we reply a user with a link to an article that answers his question, Google & Co shall NOT be told by wp: “Hey bots, don’t follow these links to helpful pages, cause wp engineers ill-thought that NO ONE wants dofollow links these days”, lol!

    WE WANT that our links are followed, that they stay clean, that wp does NOT interfere. Phew, it’s OUR CONTENT! It’s beyond me that 1) wp implemented this forced-upon nofollow, and 2) that (seemingly) no one raised their hand yet that they require dofollows at times.

    Thread Starter CoolDavidoff

    (@cooldavidoff)

    I found the solution myself now. But first let me make clear, I did NOT write:
    “We simply need to do sth like this
    add_filter(‘comment_text’, ‘auto_nofollow’);”

    I wrote: “We simply need to do sth like this
    remove_filter(‘comment_text’, ‘auto_nofollow’);”

    See the one word difference?

    I see that three times my post was “edited” by moderators, and in the cause of fairness, objectivity, and respect, I’d be grateful if mods don’t ALTER users’ posts according to their own “liking”.
    (!)

    Now, here’s the hack that works 100% correct (used it already), and sadly it has to be a wp “hack” until one of the wp programmers wakes up and realizes what a “facism” it is to auto-add “nofollow” to each and every comment link, even to those of the webadmin himself…

    In wp-includes/default-filters.php, to NOT have wp add nofollow to comment links, but instead have wp LEAVE any admin entered nofollow as it is (and where the admin didn’t put one, LEAVE it out as well!), do this:
    DELETE
    add_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 );

    That’s it. Simple. Remember to have to redo it after “every” wp update.

    Let’s all “pray” that the next wp update removes that automatic nofollow nonsense.
    Then this “hack” can be removed from our installation as well. Yeah!

    Jesus Christ, I have been having the EXACT same issue as you! Its been almost 3 days of trying to figure out how to stop this moronic “feature” inserting itself into all my comments. I can take care of nofollow/follow myself, and it really pisses me off that it isn’t so simple.

    This is a piece of code you can insert in your functions file, so you won’t have to keep editing it when the automatic updates decides to mess up your default filter file again.

    remove_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 );

    I have been trying to get it to work, but it doesn’t seem to for me.

    however, you might have better luck.

    Thread Starter CoolDavidoff

    (@cooldavidoff)

    Joe, your code for the functions.php CANNOT work: As said I had tried changing the functions myself but wp overrides that afterwards it seems.
    Years later, and sadly my hack still is the only solution to get rid of wp’s foolish forced-upon nofollow on EVERY comment, they haven’t deleted that line themselves. ??

    Allow me to add WHY wp has implemented the forced-upon nofollow and HOW to make that very reason OBSOLETE altogether:
    – wp added that to mitigate the COMMENT SPAM floods that emerged at that time.
    – BUT: the comment spam floods can SO EASILY BE AVOIDED in a MUCH BETTER WAY, and indeed with wp’s OWN features alone!

    >>> For ages we’ve been using the following settings under “Discussion” and we have ZERO SPAM issues, despite floods of bots & people TRYING to post comment spam:

    1) TICK “Allow people to post comments on new articles”

    2) “Comment author must fill out name and email” (most people’s browser settings will fill that out automatically anyway upon revisit)

    3) NO NEED to tick “Users must be registered and logged in to comment”, we can allow ANYONE trying to post spam, no problem! ??

    4) TICK “Comment author must have a previously approved comment”

    5) FILL IN “Hold a comment in the queue if it contains 1 [ONE!] or more links” [because we don’t want anyone to post links, right?! Spammers do that. While genuine site “fans” aren’t interested to market OTHER sites on OUR SITE…! Yet, you may still add a note above comment box that they may WRITE OUT a helpful URL “name only, no prefix, no suffix!”]

    6) FILL IN “When a comment contains any of these words in its content, name, URL, email, or IP, it will be put in the trash. One word or IP per line”:
    http
    www
    href=
    hard to find your posts in google
    *
    {
    |
    wrinkles
    serum
    qf
    background

    [All these are typically used by spammers, experience shows. You may add more.]

    THAT’S ALL YOU NEED in settings, to have ZERO SPAM POSTED to your site.
    So now when you have a new “fan” to your site (quality comment) you’ll approve his first comment to be published on YOUR SITE, right?
    And when a spammer or bot tries to post spam, it gets automatically into “Trash” or “Spam” (some 99.8% on our sites), and you trash the (rarely) new spam type and add that phrase to the above list. ??

    >> Even if I forgot to mention a point(??), as said, this works SUPER RELIABLE to prevent ALL spam. Enjoy!

    Thread Starter CoolDavidoff

    (@cooldavidoff)

    I feel I should reinforce the urgency for wordpress programmers to reconsider the “recent” foolish addition of “nofollow”, and then of “noopener”, to EVERY link, and DELETE that nonsense.

    Why reinforce the urgency today?
    After wp’s most recent update (thank you again, I for one truly appreciate you always keep wp up-to-date)
    … as a one-off I FORGOT to implement my hack into wp-includes/default-filters.php
    … and promptly wp quietly behind the scenes added “nofollow” to every single admin’s comment!

    Doesn’t anyone here, or in the wp programmers ivory tower(?), realize…
    … how DESTRUCTIVE this if for SEO, if you can’t merely apply common sense?

    Common sense tells us: When we put an internal link in our comment, to help users find their way on our site(!!!!), it is the utmost biggest stupidity to have wp quietly add “nofollow” to every link!

    That is misdirected anarchy, not smart programming, guys. ??

    Get rid of that. Now. You cannot truly want that every informed and thus upset wp user HACKS wp-includes/default-filters.php after EVERY update in order to get rid of that sickness, do you?

    OMG!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘delete wordpress automatic nofollow filter -plugin’ is closed to new replies.