How Do I Remove Comment Date and/or Comment Date Link

Found this code in the WP Codex but not sure how to use it to remove the hyperlink and/or date from comments.

delete_comment_meta( $comment_id, $meta_key, $meta_value );

Topic comment-meta Wordpress

Category Web


Remove your comments date Put this code in your current theme function.php file

// Remove comment date
function wpb_remove_comment_date($date, $d, $comment) { 
        return;
}
add_filter( 'get_comment_date', 'wpb_remove_comment_date', 10, 3); 

Add this to your custom stylesheet:

time.woocommerce-review__published-date {
    display: none;
}

span.woocommerce-review__dash {
    display: none;
}

Add the below code to your style.css file or in a custom.css file.(It will hide the comment metadata).

.comment-meta {
   display: none;
}

if you don't mind getting rid of the date you can add this to the CSS Inserts.

.comment-meta  {display:none;}
.comment-meta a {display:none;}
.comment-meta span a {display: inline;}

Check if your theme has its own comment template by going to [yoursite.com]/wp-admin/theme-editor.php (when logged in as an administrator). Then look at the right column and try to find comments.php file. If it's there, it controls the way your comments are displayed, so you can manually delete hyperlinks and dates from it.

If you can't find date printed out in comments.php, go to functions.php and try to find it there (search for functions containing word "comments"). Try to find get_comment_date() or get_comment_time().

And before you delete any line of code - always backup the content of the files.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.