+321 123 4567
info@test.com
  • Home
  • My Services
    • Web Design
    • Web Development
    • Technical Writing
  • Portfolio
  • My Thoughts
  • Free Tools
    • Photo Editor
    • Avatar Generator
    • Email Migration Tool
    • QR Code Generator
    • RSS to HTML Converter
    • IP Address Geolocation
    • Base64 Image Encoder
    • NATO Translator
    • All Tools
  • Contact
Home
Wordpress
Removing Links and Website Field from WordPress Comments

Removing Links and Website Field from WordPress Comments

Wale Adekile
November 25, 2013

Last month, I received up to four different requests from people likely to be offering link removal / penguin recovery service asking me to remove certain links from this blog. The links in question are not even within articles or author bio section, these are regular comment links. Obviously, the sites in question probably got engaged in shady link building and got penalized. One of the major ways to recover from penguin is deleting your toxic backlinks but this got me thinking a whole lot.


This site got hit by Penguin 2.0 but it may not only be due to our link building strategy, there’s a high possibilty some of the sites we linked to got us into trouble. There are spam comments made by bots and it’s easy to spot them but sometimes, human spammers are so clever that you would approve their spam comments without knowing it. Human spammers who comment for backlinks are much worse than bots.

The first step I took was getting rid of Commentluv but that didn’t stop it. I was thinking of going for Disqus but I sort of prefer the default WP comment system.

Of course, links within comments have nofollow attribute but this doesn’t seem to work if you’re gonna get penalized by Google. For this reason, I decided to totally remove the  website field from my comment form and also remove links from existing comments.

I know this is gonna reduce the number of comments on this blog drastically but that’s not what I’m after, having a few quality comment is much better than dozens of spammy ones posted for the sake of backlinks.

Removing links from authors name in exisiting comments

To do this, you have to either install a plugin to do it or edit your theme file. I prefer editing my theme files; the less plugins you have, the better.


-. Go to Appearance > Editor > funtions.php

– Go to the bottom of the file and paste this code:

/** Disable comment author links */
if( !function_exists("disable_comment_author_links")){
function disable_comment_author_links( $author_link ){
return strip_tags( $author_link );
}
add_filter( 'get_comment_author_link', 'disable_comment_author_links' );
}

Save the file and that’s all.

Removing links written in HTML within comments

To remove links within comments and make them appear as ordinary text, follow this step:

-. Go to Appearance > Editor > Funtions.php

– Go to the bottom of the file and paste this code:

/** Make links within comments unclickable */
remove_filter( 'comment_text', 'make_clickable', 9 );

This should do the trick.

Removing website field from the comment form:


If you wish to totally remove the website field from your comment form, you still need to edit your function.php file.

For regular WP themes

– Paste this code in functions.php and save:

/** Remove website field from comment form */
function remove_comment_fields($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','remove_comment_fields');

For Genesis theme

add_filter( 'genesis_comment_form_args', 'url_filtered' );
add_filter( 'comment_form_default_fields', 'url_filtered' );
function url_filtered( $fields ) {
if ( isset( $fields['url'] ) )
unset( $fields['url'] );
if ( isset( $fields['fields']['url'] ) )
unset( $fields['fields']['url'] );
return $fields;
}

With this done, you shouldn’t worry about getting affected by spam comments and as a matter of fact, you have much less to worry about and can focus more on content creation.


Previous Post
Top 10 On-Page SEO Factors
Next Post
The Importance of CRM (Customer Relationship Management) Software
Wale Adekile
Husband to the world's most beautiful woman and father to two awesome kids. A nerd, obviously; also, a technical business analyst, a web designer who preaches the gospel of WordPress, and a writer. You can check out my published books on Amazon.
facebook embed
WebmastersWordpress

Fix: Facebook Post Embed not Working on WordPress

10 years ago
Wordpress

7 Plugins & Tips to Effectively Manage a Multi-Author WordPress Blog

13 years ago

Recent Articles

wahl rapic clip hair clipper
Wahl Rapid Clip Hair Clipper Review: DIY Made Easy
BenQ LaptopBar Review: Luxury or Necessity?
yunmai easepro unboxed
Yunmai EasePro Massage Gun Review
g20
Teendow G20 Robot Vacuum and Mop Review
bathroom
Dear Men, Spraying All Over the Toilet Seat is Disgusting and Irresponsible
winx mediatrans
How to Transfer Photos from iPhone to Computer Without iTunes
google workspace
How to Migrate Emails From Google Workspace/G Suite to cPanel
synology diskstation ds920+
Synology DiskStation DS920+ Review
playstation 4
Why I haven’t Upgraded to the PlayStation 5 Yet
pain
Started Watching Anime as an Adult? You’re Not Alone

All contents on this blog are copyright protected and cannot be reproduced on other websites without permission.

Copyright © 2022 – NerdieDad | Home | Contact | About | Privacy Policy