Did you know that whenever someone enters a URL in a WordPress comment, it gets auto-converted into a link? While this might seem helpful, it can actually invite spam or clutter your comment section with unnecessary links.
Disabling this feature not only provides more control over how links appear but also enhances the user experience by preventing accidental linking. In this guide, we'll walk through the steps to disable auto-linking of URLs in WordPress comments, ensuring your website maintains its desired formatting and functionality.
Why Disable Auto-Linking in WordPress Comments?
- Cut Down on Spam: Spammers often leave links in comments to promote their own sites. Disabling auto-linking makes those links less useful because they won’t be clickable.
- Keep Comments Clean: Long or messy URLs can clutter your comment section. Turning off auto-linking keeps the focus on the actual conversation.
- Avoid Accidental Links: Sometimes, people type something that looks like a link by mistake. If it turns into a clickable link, this can confuse other readers. Disabling auto-linking prevents that.
Steps to Disable Auto-Linking of URLs in WordPress Comments
Option 1: Using WPCode Plugin
1. Log in to your WordPress dashboard.
2. Go to the Plugins > Add Plugin.
3. Search for WPCode.
4. Click on Install Now and activate it.
5. After the installation, navigate to the Code Snippet > Settings.
6. Click on Connect to the WPCode Library.
It will ask you to register a new account, enter your details, and click on Register.
7. Click on Connect to WordPress.
8. Go to the Code Snippet > +Add Snippet.
9. Next, click the ‘Comments’ filter to quickly find the ‘Disable Comment URL Linking’ snippet.
10. Click on Use Snippet.
11. The code is already set up, so all you need to do is switch the toggle from ‘Inactive’ to ‘Active’ and then click ’Update’.
Your WordPress site will no longer automatically link URLs in comments.
Option 2: Using Functions.php File
1. Log in to your WordPress dashboard.
2. Navigate to the Tools > Theme File Editor.
3. Choose the functions.php file from the right side of the page.
4. Add the below code to your file.
remove_filter( 'comment_text', 'make_clickable', 9 );
Option 3: Using Comment Link Remove Plugin
1. Log in to your WordPress dashboard.
2. Go to the Plugins > Add Plugin.
3. Search for the Comment Link Remove and Other Comment Tools plugin in the search bar.
4. Install the plugin and activate it.
5. Next, go to the Comment Tools.
6. Check the checkbox that says “Disable turning URLs into hyper-links in comments”.
This setting prevents WordPress from converting plain URLs (like http://example.com) into clickable links in the comments section.