Monday, April 24, 2017

If someone spammers on your WordPress site post it will be automatically deleted

If someone spammers on your WordPress site post it will be automatically deleted. Take a look at this new tune
Assalamu Alaikum
At present, almost everyone is falling in front of WordPress. Blogging or ecommerce or any other site ... can be done with this wordpress. So, the wordpress has increased greatly by extending the other CMSs.
Wordpress has created a site, but there is no such thing as spam commentary? Stay there! There is no need to raise hands.
Really spamming is a big problem and trouble. You are posting hard, and from where a foreign visitor comes and comments, online dating, viagra, backlink bot etc., creating your backlinks and outranking your site! I would like to suggest to use the Akismet plugin. It is able to prevent spam from 100% and it is provided by default with WordPress. However, it is necessary to activate the API and work goes with its Free API. But the problem is that the spam block in the AKismet plugin is right but they are not automatically deleted, put in the spam queue. From there you have to manually delete. Although it is a matter of few clicks, it is a matter of few clicks. But if the comment number is extra, then get in trouble.
Anyway, do not raise the word, let's start.
Step: ~~~ Visit your WordPress site Apparance> Editor> Select the functions.php file from right. And at the end of the end;?> Before submitting this code, please submit it.
// AUto Spam Comments Removal by MiraZ Mac </ p>
<P> function in_comment_post_like ($ string, $ array) {<br />
Foreach ($ array as $ ref) {if (strstr ($ string, $ ref)) {return true; }} <br />
Return false; <br />
} <br />
Function drop_bad_comments () {<br />
If (! Empty ($ _ POST ['comment'])) {<br />
$ Post_comment_content = $ _POST ['comment']; <br />
$ Lower_case_comment = strtolower ($ _ POST ['comment']); </ p>
<P> // List of prohibited words in comments. <br />
// Comments with these words will be auto-deleted. </ P>
<P> // Add more if you know how to use array <br />
$ Bad_comment_content = array (<br />
'Viagra', <br />
'Hydrocodone', <br />
'[Url = http', <br />]
'[Link = http', <br />
'Xanax', <br />
'Tramadol', <br />
'Lorazepam', <br />
'Adderall', <br />
'Dexadrine', <br />
'No prescription', <br />
'Oxycontin', <br />
'Without a prescription', <br />
'Sex pics', <br />
'Family incest', <br />
'Online casinos', <br />
'Online dating', <br />
'Cialis', <br />
'Amoxicillin' <br />
); </ P>
<P> if (in_comment_post_like ($ lower_case_comment, $ bad_comment_content)) <br />
Wp_die (__ ('Darn! Your comment contains prohibited words.')); <br />
} <br />
} <br />
} <br />
Add_action ('init', 'drop_bad_comments');

Finish the job Now commenting with such a ward itself, whether it was successful or not. If you're a little expert on PHP, you can add wards (which you want to auto delete) to the array.

No comments:

Post a Comment

গুগল অ্যাডসেন্স কি??

Top 10 Freelancing Websites in Bangladesh

 Top 10 Freelancing Websites in Bangladesh 1) Upwork Website: https://www.upwork.com/ 2)Fiverr Website: https://www.fiverr.com/ 3) Freelance...