Site logo

Archived topic

How To Remove URL Field From WordPress Comment Form

30 replies · Started by lee on May 18, 2018

Viewing posts 16–30 of 31

i have removed above code and now working fine

one more question how to show only 10 comment in one time when there is more than 10 comment

Can you open a new topic for a separate question?

Thanks!

It is easy. Just go to wordpress settings and then discussion. You can set your desired number to be displayed and sort accordingly

Tom's code is working. Thanks.

Great to hear :)

I don't want to remove the email field.

Only want to remove URL

What if you remove this line from the code?
unset($fields['url']);

It worked but also removed the Email...

But I don't want to remove email

Sorry so what if you remove this line from the code instead?
unset($fields['email']);

It is adding the URL field, and Email still not showing.

Can you try this exact code?

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;
}

It's working for me:
https://wordpress-202309-991531.cloudwaysapps.com/?p=1

I've added the exact code and but still not working... SEE here https://prnt.sc/qvx0u7

Updated: After clearing the cache, it is working...

Thanks for the help.

This archived topic is closed to new replies.