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 );
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityFound 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 );
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);
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.
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;}
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;
}
Add this to your custom stylesheet:
time.woocommerce-review__published-date {
display: none;
}
span.woocommerce-review__dash {
display: none;
}