How to Disable Auto Linking of URLs in WordPress Comments

Get real time updates directly on you device, subscribe now.

Did you know that when a user adds a regular text URL in his comments, WordPress makes it automatically clickable? Recently one of our readers asked us if it was possible to disable the automatic linking of text URLs in WordPress responses. The answer is yes. In this article, we’ll show you how to disable the automatic linking of URLs in WordPress comments.

Why WordPress URLs with text auto links in comments?

WordPress automatically converts text URLs into links, making it easier to visit the link while moderating comments.

This automatic link is not stored in your database. WordPress makes URLs clickable when they appear on the screen in the breathing area and in the comments section below your articles.

Some of these comments are genuine if commentators did not know how to add a link in comments. But many spam comments also contain regular URLs that are pasted directly into the response text.

Disable Auto-Link in WordPress comments

Simply add this line code to the  function.php  file of your theme or in a  site-specific plug-in.

WordPress does not store plain text URLs as links in the database. Instead, it immediately changes into clickable links. With this code, the filter that clicks on URLs is simply disabled.

This makes plain text URLs non-clickable in the administrative areas and responses section of your messages. If you delete this code, automatic pairing will be re-enabled.

If you add it to the function.php file of your theme, updating your theme will overwrite your function file.

Also, keep in mind that this code only works for URLs with plain text. If a user has decided to create a link by adding the correct HTML tag, those links will be displayed as they should.

We hope this article helped you disable automatic linking of URLs in WordPress comments. 

Get real time updates directly on you device, subscribe now.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More