When you buy through links on our site we may earn.

In WordPress, How to Remove Website URL from Comments

In WordPress, How to Remove Website URL from Comments

I wanted a while back to find out how to remove the website URL. This was when people were leaving their comments at the bottom of any of my WordPress Pages and Posts where I allow comments.

This is a great way to encourage conversations. Sometimes people ask related questions in comments.

My reply to those comments means that potentially, other readers would find that information useful. This allows comments to act as additional sources of information for you.


Below is the desired affect


In WordPress, how to remove website url from comments

Remove URL from commentsIn the end for me, this required a code change to one of the underlying code files under the hood. So before making any changes like this, it is recommended to backup your website and WordPress files. I tend to be very careful, and tend to document my changes in case I have to revert back. You should too.

  • WordPress Dashboard, Appearance, Editor
  • Select the Theme Functions file (usually called functions.php)
  • Then at the bottom of the file, add code similar to the following:
    Sample HTML source to remove website from comments in WordPress
  • Check and double check and triple check that your code is exactly the same as above.
  • Click on the update file button to save these changes.
  • Test the change to ensure you are happy with it.
  • If not, either revert back to what the code was before or check again that the code is exactly the same. Then save the change, and test the change again. Repeat these steps until you are happy.

This approach worked for me with the WordPress Theme I used at the time of writing this. There is no guarantee that it will work for you.

Meet David Who Runs This Website
Article by:
Hi, I'm David, the senior editor and senior writer at Work From Home Notes covering products, apps, services, and work from home issues and trends. Prior to launching Work From Home Notes I was an IT professional for over twenty seven years. Now I work from home. Read more.