Skip to main content

If you are a blogger on WordPress, then you should maintain the site with posts updated with fresh content always. But in certain cases, you might not be able to do that, when you have too many websites or you don’t follow up with updates on your existing content. So In order to tackle that, you need to remove the date and time of the post. But after hiding the date and time on WordPress, you should consider doing the same on the comments section, or else you may be exposing the date on the comments. So if you have no idea how to remove date and time on your WordPress comments section then continue reading the article to know all the possible ways to make that happen.

Ways to Remove Date and Time from WordPress Comments

There are two possible ways using which you can hide or remove date and time from your WordPress comments. They are

  • Pull out Date and Time from Comments manually
  • Pull out Date and Time from Comments using a Plugin

Remove Date and Time from Comments manually

The Manual method involves injecting few lines of code that is easy to catch up with. All you need to do is copy and paste the code snippet to your WordPress PHP. Here is how to do it.

[1] From your WordPress Dashboard, choose Appearance from the left panel.

[2] Choose Theme Editor from the Appearance menu.

Remove Date and Time from WordPress Comments
[3] Choose Theme Functions (functions.php) from the Theme files section.

Theme functions

Note: You can open the function.php file via code editor from your FTP.

[4] Add the following lines of code in the function.php file.

//Remove Comment Date

function wpb_remove_comment_date($date, $d, $comment)
{
if ( !is_admin() )
{
return;
}
else
{
return $date;
}
}
add_filter( ‘get_comment_date’, ‘wpb_remove_comment_date’, 10, 3);


//Remove Comment Time

function wpb_remove_comment_time($date, $d, $comment)
 {
 if ( !is_admin() )
 {
 return;
 }
 else
 {
 return $date;
 }
 }
 add_filter( ‘get_comment_time’, ‘wpb_remove_comment_time’, 10, 3);
[5] Once the code is added, you can see the date and time removed from your blog.

But even after removing the date and time on your blog, you can still find the prefix like posted at or comment at or at next to the commenter name. In order to remove that

[1] Right-click on your browser pointing the comments section of your blog.

[2] Choose Inspect or Inspect element from the context menu.

Inspect
[3] Now you can see the code behind the comment section in the inspect on the right or bottom of your browser.

[4] Note down or remember the CSS class under which the Date/time is added. Most probably it is either div or span in your theme.

Remove Date and Time from WordPress Comments
[5] Go your Theme CSS file from Appearance >> Customization

Customize
[6] Click on Additional CSS and paste the following line of code in the CSS code editor.

Remove Date and Time from WordPress Comments
//Remove comment prefix

.comment-time {
display:none;
}
[7] Now you can successfully removed the date and time from the comments section.

Remove Date and Time from Comments using Plugin

[1] Go to Plugins section from the dashboard and click on Add New.

Add new
[2] Search for the Plugin named Better Recent Comments in the search bar.

Remove Date and Time from WordPress Comments
[3] Click on Install Now to install the plugin. And after installation, click on Activate.

[4] Once the plugin is activated, Go to the Appearance section and choose Widget.

[5] Here you can see all the available widgets on your WordPress.

[6] Drag and drop the Better Recent Comments to the Comments section on the left panel of your dashboard.

Better recent comments
[7] Now add the number of comments to display and uncheck the show data box.

Remove Date and Time from WordPress Comments
[8] Once all done, click on Save to apply changes.

[9] Now you have hid your date and time on WordPress successfully.

Pros and Cons of Removing Date and Time from Comment section

Removing the date and time of the comment may not always be as expected for bloggers. Because in some case if you have made a change or update on the post and the comment say something related to the before the update which may seem odd on your blog. So make sure to look out for all possible uncertainty before making the change. If you having a site based on some product then it won’t be an issue.

Conclusion

Hope this article helped you keep your old posts seem updated to your users. There is no need to backup your WordPress site in this case but if need you can do it anytime you needed. If you have any trouble or issue with removing the date and time from the WordPress comments section let us know in the comments section below. For more guides and tutorials on various aspects and facets of WordPress, check out our blog.

Leave a Reply