Are you looking for a solution to know, 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 from WordPress comments.

Is it OK to Remove Date and Time from WordPress Comments?

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

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

they can see positive comments, which 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 post/page 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 the date and time from the comment section of your WordPress website you need to add some code to 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 and navigate to Appearance > Theme Editor, just as shown in the screenshot below.

remove date and time from wordpress comments 2

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.

remove date and time from wordpress comments 3

Open the 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.

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

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

Remove Date and Time from WordPress Comments

here you can see codes, from here you have to find the comment metadata, and 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?

remove date and time from wordpress comments 5

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 the above CSS through on Theme editor, by doing the above-mentioned method, that we have done while editing the 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 paste the CSS code, as shown in the screenshot below. After that click on the Publish button to save your changes.

remove date and time from wordpress comments 7

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 mean you have edited the code on the database.

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.

Please Subscribe to our YouTube Channel, we also upload great content there and also Do Follow us on Facebook and Twitter

Read More:-

Recommended WordPress Themes

ThemePurposeGet Deal
ZitaMultipurposeGet Discount
OnelineOne PageGet Discount
DiviMultipurposeGet Discount
GeneratePressMultipurposeGet Discount