hkchina
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hueman] How to Remove Website URL Field from Comment FormDo back up the /wp-comments-post.php before and after you make the changes. Before, so that nothing breaks on your site, and after, because a WordPress update may over-write the /wp-comments-post.php file, thus requiring you to re-do the mentioned changes.
Forum: Themes and Templates
In reply to: [Hueman] How to Remove Website URL Field from Comment FormFollow these steps:
1. Create a Child Theme. This will prevent your changes from being overwritten when the theme gets updated.a. Create a folder called “hueman-child” in the wordpress/wp-content/themes/ folder, i.e. the parent folder of the “hueman” folder.
b. Create a file called “style.css” in the “hueman-child” folder.
c. Go to the Appearance -> Themes section of your WordPress Admin Dashboard and activate the “hueman-child” theme.2. Disable display of the Website URL field: Edit the “style.css” file in your hueman-child folder by adding the following:
.comment-form-url {
display: none;
}3. Disable spam bots which automatically post comments:
In /wp-comments-post.php (should be in your wordpress folder)
find :
——————————————————
$comment_author = ( isset($_POST[‘author’]) ) ? trim(strip_tags($_POST[‘author’])) : null;
$comment_author_email = ( isset($_POST[’email’]) ) ? trim($_POST[’email’]) : null;
$comment_author_url = ( isset($_POST[‘url’]) ) ? trim($_POST[‘url’]) : null;add after :
—————————————–
if (!empty($comment_author_url))
wp_die( __(‘Sorry, no spam here…’) );Now, the “Website” field will no longer be displayed for your website and SPAM with the “URL” field will be rejected.