BPOVIA Website Design

Icon

Provides High-quality Web Design And Maintenance Service In The World

Prevent the Commenter from Falsely Claim to be the Administrator

There is a problem that by default WordPress won’t check if the comments are left by the administrator, so if somebody knows the nickname and the Email of the administrator (which can be fetched easily), then he would be able to falsely claim to the administrator and leave comments and cheat other visitors. This turns out very dangerous to the webmaster’s reputation. if he doesn’t check his blog for several days.
In WordPress 3.0, go to wp-comments-post.php under the installation folder and open it with a text editor, find the following codes (almost around Line 70):
1 if ( get_option(‘comment_registration’) || ‘private’ == $status )
2 wp_die( __(‘Sorry, you must be logged in to post a comment.’) );
And replace them with:
1// Change admin to the nick name of the administrator.
2// Change 2@3.com to the email address of the blog administrator.
if (‘admin == $comment_author || ‘2@3.com‘ == $comment_author_email) wp_die
if (get_option(‘comment_registration’) || ‘private’ == $status ) wp_die(__(“Sorry, you must be logged in to post a comment.’) );
The code above just makes a preliminary judgement, there is no need to read the database or reload relevant functions, so it won’t take a long time. And to blog owners, please log in before leaving the comments.
BPOVIA All Rights Reserved
Maintained by BPOVIA Web Design Team

Category: website, WordPress

Tagged: ,

One Response