The purpose of most netizens in the blog comments is to leave their own website links, promote their own website and get a little weight. Although in recent two years, with the change of search engine algorithm to reduce the weight of comments, there are still many users who are busy with these things. Of course, it also includes a large number of potential netizens like Lu Songsong’s blog comments in order to get the return visit traffic.
When visiting the Moonlight blog, we saw that there were still many comments below. The URL text box that submitted the comment box had been removed, and the location of the user’s nickname didn’t point to the URL. This is bound to give users a return visit and reduce the user experience, but it can reduce spam comments and invalid user messages. Those who really need interactive messages may not care whether they leave links or not.
As a result, we tribe also plans to cancel the option of URL text box, and cancel the previous comments with URL nicknames. Originally, they planned to use third-party comments, but they are not ready to start them for the time being. Now they are investigating which third-party comments to choose.
First, forbid comment form text box code
/ / remove the default comment URL text box < br > fromadd_ filter(‘comment_ form_ default_ fields’, ‘unset_ url_ field’);
function unset_ url_ field($fields){
if(isset($fields[‘url’]))
unset($fields[‘url’]);
return $fields;
}
There is a problem. The general default theme can be removed automatically, but most themes will have custom fields, so we can’t cancel the URL form text box. We need to remove it manually.
Second, manually remove the text box URL
If you can still see the submission text box of the comment URL address by using the above code, we need to solve this problem in the template. ( comments.php )
Find the location of the text URL and remove the replacement. Here we are not familiar with a backup, and then make a mistake can be saved.
It seems that deletion is right. What we want is this effect.
Third, batch prohibit existing URL comment nickname
/ / delete linked nickname URLsfunction disable_ comment_ author_ links( $author_ link ){
return strip_ tags( $author_ link );
}
add_ filter( ‘get_ comment_ author_ link’, ‘disable_ comment_ author_ links’ );
If you have a comment nickname with URL before, you can ban it in batches through the above code. First, the third in the code, all manually added to the current theme Functions.php File.