- This topic has 30 replies, 10 voices, and was last updated 6 years, 1 month ago by
Leo.
-
AuthorPosts
-
May 18, 2018 at 9:36 pm #579293
lee
Invalid code below
add_filter('comment_form_default_fields', 'website_remove'); function website_remove($fields) { if(isset($fields['url'])) unset($fields['url']); return $fields; }function crunchify_disable_comment_url($fields) { unset($fields['url']); return $fields; } add_filter('comment_form_default_fields','crunchify_disable_comment_url');May 19, 2018 at 4:43 am #579411David
StaffCustomer SupportHi Lee,
can you try this:
add_filter('comment_form_default_fields','generate_disable_comment_url'); function generate_disable_comment_url($fields) { unset($fields['url']); return $fields; }May 19, 2018 at 5:43 am #579431lee
Unable to delete
[img]https://i.imgur.com/ozYjwzv.jpg[/img]
May 19, 2018 at 5:51 am #579437David
StaffCustomer SupportCan you try clearing your caches
May 19, 2018 at 6:18 am #579447lee
Hi David
Clearing Caches can’t delete itJune 1, 2018 at 4:22 pm #589854Chandra
Hi, since WordPress 4.9.6 this code won’t work. Maybe because there is an additional field related to GDPR in comment form. And Google results are note helping because there is no new code that compatible after the 4.9.6 update.
Anybody can confirm this and maybe create updated solution?
Thanks.
June 1, 2018 at 8:57 pm #589904Tom
Lead DeveloperLead DeveloperSorry we didn’t get back to you, lee!
Can we try this instead?:
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; }June 1, 2018 at 9:15 pm #589909Chandra
thanks Tom. that code is working! while i use in generatepress too, can it be used on another theme?
June 2, 2018 at 5:58 am #590061David
StaffCustomer SupportHi Chandra, it’s a WP filter so any theme that respects that should be fine.
July 8, 2018 at 7:08 am #618543Anil
Code here is working fine:
July 21, 2018 at 9:09 pm #629475Anoop Kumar Vaishya
nothing working
July 21, 2018 at 9:29 pm #629491Leo
StaffCustomer SupportI just tested the code here and it worked nicely:
https://generatepress.com/forums/topic/how-to-remove-url-field-from-wordpress-comment-form/#post-618543How are you adding the code?
July 21, 2018 at 9:35 pm #629494Anoop Kumar Vaishya
where have to add ? i’m putting in style.css
July 21, 2018 at 9:45 pm #629498Leo
StaffCustomer SupportTry one of these methods:
https://docs.generatepress.com/article/adding-php/Code Snippets is the easiest if you aren’t using a child theme.
July 21, 2018 at 9:53 pm #629503Anoop Kumar Vaishya
oh sorry i’m using to code same time
#commentform .comment-form-url {display:none;} -
AuthorPosts
- The topic ‘How To Remove URL Field From WordPress Comment Form’ is closed to new replies.