Home / Comments / Disable Comment Form Website URL
Duplicate Snippet

Embed Snippet on Your Site

Disable Comment Form Website URL

Remove the Website URL field from the Comments form.

2.2k
Code Preview
php
<?php
add_filter( 'comment_form_default_fields', function ($fields) {
	if ( isset( $fields['url'] ) ) {
		unset( $fields['url'] );
	}
	if ( isset( $fields['cookies'] ) ) {
		// Remove the website mention from the cookies checkbox label.
		$fields['cookies'] = str_replace('name, email, and website', 'name and email', $fields['cookies']);
	}
	return $fields;
}, 150 );

Comments

Add a Comment