Site logo

Archived topic

How to remove commen date and website field from comment section

3 replies · Started by Balendu on August 20, 2021

Viewing posts 1–4 of 4

I wanted to remove comment date and website field from comment section.

Hi there,

To remove the URL field, try this PHP snippet:

add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
function tu_add_comment_url_filter() {
    add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
}

function tu_disable_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

To completely remove the date is not easy, see Tom's reply here:
https://generatepress.com/forums/topic/remove-comment-author-url-link-and-comment-date-time/#post-1555381

But you can try this CSS to hide it:

.entry-meta.comment-metadata {
    display: none;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know if you need further assistance :)

Thanks it Works,

You are welcome :)

This archived topic is closed to new replies.