Anyone who has installed WordPress knows that the latest versions all come with the Akismet anti-spam comment plug-in, but you need to apply for a key to enable it officially. If you want to follow the prompts to apply, it is found that one of the steps in the application process cannot be opened, and Akismet immediately determines that it is a spam, but it still writes the spam message data to the database, which consumes a lot of resources. Therefore, rue is ready to give up using this plug-in.
Use the spam filter plug-in
Finally selected[Some Chinese Please]This plug-in is very effective for English spam messages. It will judge whether the content contains Chinese characters during the message submission process. If it does not exist, an error message will be returned and the message will not be written into the database, in this way, the spam message is reduced by more than 90%.
[Some Chinese Please:
A necessary defense spam plug-in for blogs written in Chinese. This is a defense spam plug-in for friends who write in Chinese. It can effectively intercept comment and trackback (pingback) with no text in the content, and does not write it into the database. It can effectively reduce spam's unnecessary use of the blog server.
Click install plug-in under the wordpress background menu, and search for Some Chinese Please. The first result is the plug-in, written by binggu. You can also download the installation, download address: http://wordpress.org/plugins/some-chinese-please/
This wordpress tutorial is here, and the installation steps are cumbersome. If you don't understand it, you can leave a message. Happy club will reply to you immediately. After installation, you can modify some simple functions in SCP Setting under "Settings" in the wordpress background.
Use custom code to filter out junk code
First, I am targeting English spam messages.
The code modification method is good. Add the following code at the beginning of the functions. Php file of the current topic style:
The code is as follows: |
Copy code |
Function scp_comment_post ($ incoming_comment ){ $ Zhcn = '/[1-?] /U '; If (! Preg_match ($ pattern, $ incoming_comment ['Comment _ content']) { Wp_die ("You shocould type some Chinese word in your comment to pass the spam-check! <Br/> Sorry, the blog only supports Chinese comments. Please make sure your comments contain Chinese! "); } Return ($ incoming_comment ); } Add_filter ('preprocess _ comment', 'scp _ comment_post '); |