Are you looking for a solution to know about, how to Remove Date and Time from WordPress Comments?

Well, don’t worry, in this article we have a complete solution for you, after applying it you can easily remove date and time form WordPress comments.

Will removing date and time from WordPress comments is ok?

Yes, it’s totally fine. some users believe that the date and time in the WordPress site will prevent their articles from viewing and thus improve their WordPress SEO.

removing date and time form a WordPress post will help to provide fresh comments to the new user,

they can see positive comments, that will lead them to engage more in your article.

In this tutorial, I’m going to show you how you can remove the date and time from the WordPress comments.

Remove Date and Time from WordPress Comments

We will tell you a method to remove time and date from WordPress comments, by implementing some code on your website.

Removing Date and Time from Comments by Using Code

To hide date and time from the comment section of your WordPress website you need to add some code into your Theme’s functions.php file.

Remove Date and Time from WordPress Comments

I know lots of users find it difficult, but don’t worry we will tell you every step that will help you to insert the code. so let’s get started.

Firstly you have to log in to your WordPress Dashboard, navigate to Appearance > Theme Editor, just as shown on the screenshot below.

Now you will land on the Theme editor page, here on the right side you will see a functions.php file, click on that file. as shown in the screenshot below.

Open functions.php file and enter the following code.

function theme_prefix_remove_comment_date($date, $d, $comment) { 
    if ( !is_admin() ) {
        return;
    } else { 
        return $date;
    }
}
add_filter( 'get_comment_date', 'theme_prefix_remove_comment_date', 10, 3);
// Remove comment time
function theme_prefix_remove_comment_time($date, $d, $comment) { 
    if ( !is_admin() ) {
            return;
    } else { 
            return $date;
    }
}
add_filter( 'get_comment_time', 'theme_prefix_remove_comment_time', 10, 3);

After inserting the code don’t forget to update the file. Click on the Update file button.

Now you can see, the date on the comments has been removed, now if you see a text, (at) in comments then you have to hide it via custom CSS, so let’s know how you can do that.

Thet text (at) is basically denoted for the time, at which comment has made, so for hiding that,

you have to right-click on the (at) and click on the inspect elements, as shown on the screenshot below.

Remove Date and Time from WordPress Comments

here you can see code’s, from here you have to find the comment metadata, date-time and click on it,

After that, you need to copy the CSS class. Which is used in the surrounding div or span around date and time in the theme section of your website? as shown in the screenshot below.

Now you have to add the following custom CSS to your theme.

.comment-time { 
display:none; 
}

Note:- the comment-metadata class may change depending on which theme you’re using.

You can insert above CSS through on Theme editor, by doing the above-mentioned method, that we have done while editing functions.php file.

But will tell you a more easy method to inset the CSS.

just open your WordPress dashboard, and go to Appearance > Customize.

how to hide date and time from wordpress comments

Now click on the Additional CSS, and past the CSS code, as shown on the screenshot below. After that click on the Publish button to save your changes.

As you can see, the custom CSS has successfully removed the time from the comment section of your website.

After doing all things, you will see, that you have removed the date and time from your WordPress comments.

Remove Date and Time from WordPress Comments

Please note that doing this will only work until you change your default WordPress theme, doing this not means you have edited the code on the database to.

Conclusion:-

Today you have learned how you can Remove Date and Time from the WordPress Comments section. by doing this you can give your users more relevant content so that they can engage more in your articles.

Was this article helpful for you? if yes comment down your thoughts, and if you don’t understand something you can ask us via the comment section below. Thanks for reading this blog.

Read More:-