How to Display latest comment on top in WordPress

When comments are added to a WordPress post, they are arranged from the oldest to the newest by default. For example, let us look at this WordPress post. We have the oldest comment posted on July 3, 2015, at the top while the newest posted on February 21, 2018, at the time of writing this tutorial appears at the bottom. However, you can reverse this and have the comments showing with the newest at the top and the oldest at the bottom. In this post, I am going to show you how to have the newest comments displaying at the top.

Read moreHow to Display latest comment on top in WordPress

How to remove the url field from the comment form

If you have ever run a blog, you must have faced the problem of comment spam. Spammers engage in comment spam for link building purpose.

One simple way to discourage spammers is to remove the url field from the comment form. This will ensure that spammers cannot use your comment form for link building purpose.

In this post I will share a small snippet which will remove the url field from your comment form.

I recommend you to use the code snippet plugin in order to run this piece of code. Using the code snippet plugin ensures that your changes remain intact even after you change your theme.

Read moreHow to remove the url field from the comment form

How to Turn Off Comments on WordPress Pages

In this tutorial I will share a simple snippet which allows you to disable / turn Off comments on WordPress Pages.

The snippet is quite simple and does two things

1) It first checks if the post is of type ‘page’. The check is done after the post object is completely created.

2) In case the post belongs to disabled category, the code uses comments_open() filter to close the comments on the page.

Read moreHow to Turn Off Comments on WordPress Pages

How to Disable and Hide Comments on Posts of specific categories

In this tutorial I will share a simple snippet which allows you to disable / hide comments on Blog Posts of selected categories.

The snippet is quite simple and does two things

1) It first checks if the post belongs to disabled categories. The check is done after the post object is completely created.

2) In case the post belongs to disabled category, the code uses comments_open() filter to close the comments on the particular post.

Read moreHow to Disable and Hide Comments on Posts of specific categories