removing website field from comment box

Posted in: Newspaper
Post count: 53

Hello,

I want to stop all automatic spam comments on my site. So wanted to remove the website field and disallow submitting comments if a user enters any link in the comment box.

Is the following functions.php code compatible with the Newspaper Tech news demo theme?

To Remove Comment Author Link:


function tagdiv_remove_comment_author_link( $return, $author, $comment_ID ) {
return $author;
}
add_filter( 'get_comment_author_link', 'tagdiv_remove_comment_author_link', 10, 3 );

function tagdiv_remove_comment_author_url() {
return false;
}
add_filter( 'get_comment_author_url', 'tagdiv_remove_comment_author_url');

To protect entering the website/link in the comments summary box

function remove_website_field($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields', 'remove_website_field');

If the above code is not compatible, please share the correct one.

Regards,

Post count: 27744
Post count: 53

It worked on desktop site but i am using mobile plugin and it is not removing website field on mobile site.

screenshot

Post count: 27744

Hello,

Please try to add the code for the mobile theme in wp-content/plugins/td-composer/mobile/functions.php -> https://i.imgur.com/gHq11Rh.png

Thank you!

Post count: 53

Do i need to add the code each time plugin updates or theme updates?

Post count: 21065

Hello @lalit!

Any change you make in the files after update will be overwritten and you have to make the changes again. Better save the code somewhere and then apply it again after update.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.