Rick's Daily Tips

Your daily dose of practical, easy to follow tech tips!

  • Home
  • Rick’s Bio
  • Advertise
  • Privacy Policy
  • Rick’s Tip Jar
  • Get My Tech Tips Newsletter
  • Contact Me
You are here: Home / Tech Questions & Answers / Q&A: How can I prevent URLs left in comments on my blog posts from automatically becoming active links?

Q&A: How can I prevent URLs left in comments on my blog posts from automatically becoming active links?

Posted on January 20, 2020

Question from Kim W.: I have a WordPress blog and lots of people are leaving comments on my posts that contain links.

How can I prevent the URLs in those comments from automatically becoming active links?

I really don’t want hackers leaving links to malicious websites via comments on my blog posts!

Thanks for your help.

Rick’s answer: You’re certainly not alone, Kim. Plenty of other bloggers feel the same way you do about the autolinking of comment URLs.

Luckily, there’s an easy way to disable autolinking in your blog’s comments just by adding a single line to one of your theme’s files. (Note: If you make the change to a child theme you won’t have to worry about the change being overwritten by a theme update).

But before I explain how to do make this change, I ask that you read my semi-standard disclaimer:

Making changes to any of the files that make up your WordPress installation can cause serious issues with your blog if even a minor error is made. In fact, a single misplaced character could prevent your blog from loading at all.

That’s why I always strongly recommend making a backup copy of every file you plan to alter before you make any changes.

After reading, understanding and agreeing to the above disclaimer, you can proceed (at your own risk) by following the steps below:

1 – Open the functions.php file that’s located in the directory containing your blog’s theme (or preferably a child theme).

2 – Save a backup copy of the unchanged functions.php file so you’ll be able to quickly reverse any changes should something go wrong.

3 – Add the following line to the very end of the original file:

remove_filter( ‘comment_text’, ‘make_clickable’, 9 );

4 – Save the altered functions.php file and upload it to your server.

That’s all there is to it. If you refresh the page for one of your blog posts that has comments containing URLs, you should see that those URLs are no longer active links (i.e. you can’t click on the URL to open the page it points to).

I hope this helps Kim. Good luck!

Bonus tip #1: Click here to learn how to easily hide the date/time on the comments on your WordPress blog.

Bonus tip #2: Want to make sure you never miss one of my tips? It’s easy! Just…

Click here to sign up for my free Rick’s Daily Tips Email Newsletter!


Would you like to ask Rick a tech question? If so, click here and send it in!

If you found this post useful, would you mind helping me out by sharing it? Just click one of the handy social media sharing buttons below. Thanks a bunch!






Popular…

How do I ask you a tech question?

Step-by-step guide to completely ridding your PC of viruses and other malware

10 reasons why I recommend buying tech gear from Amazon

How to upscale video – Top 4 AI video enhancers in 2023


Advertise

Guest Post Guidelines

Want to ask me a tech question?

Handy Tech Resources

Privacy Policy

Computer Tips
Smartphone Tips
Blogging Tips

Tech Q & A
Reviews
Tech News

Write for RicksDailyTips.com

Scam alerts
Downloads

Copyright © 2025 RicksDailyTips.com

Affiliate Disclaimer


Rick's Daily Tips is hosted by InMotion Hosting. Click here to find out why.

This blog uses cookies to ensure that you receive the best experience on my website. Please click 'Accept Cookies' to continue.Accept CookiesRead our Privacy Policy