Is bbPress spamming too many topics and replies?

bbPress pending post

If you have upgraded to bbPress 2.6.3, you may have noticed that moderation is a lot stricter now. While this is good for forums that get spammed a lot, it can be really annoying for private forums with a trustworthy member base or smaller community based forums with familiar members as it adds a lot more moderation work and is also annoying for members.

So how do you fix moderation so members legitimate posts stop being placed into moderation? After all, as an Admin, the last thing you want to do is spend the rest of your life approving forum replies.

It seems content rich discussions are being penalized and replies are increasingly placed into the moderation queue after a simple post edit or even a new reply being placed into moderation for what seems like no reason at all. Here is a simple solution that will likely fix the issue:

  1. Go to Settings > Discussion
  2. Scroll down to ‘Comment Moderation’.
  3. You will see how many links you are allowed before a comment is held in the queue. Chances are it will be two links. Increase this number and bear in mind that external images and videos are links. If your community regularly posts multiple images and videos then increase links to say 10 or 12. Just remember that spammers posts links, so increasing this will enable these spammers posts to get through as well.

That’s it. If this doesn’t fix the issue entirely, then there maybe other things you can do, but upping the amount of links before moderation will save moderators a lot of work.

Hide pages in WordPress search based on a template

Here is some code that allows you to hide pages from WordPress search based on the pages using a specific template.

Let’s say you had a Members Only section that was accessible by logged in members to your site. But what happens when this locked down content appears in your site’s search results? Below is a way you can hide these pages from appearing in the search results.

Step 1)
Create a template or clone / copy an existing template and call it something like Exclude Search Template (exclude.php) or Members Template (members.php). Place (e.g., FTP) your template into your child theme’s directory.

Now place the below code into your child theme’s function file. Makes sure the name of the template appears in the code below.

function exclude_page_templates_from_search($query) {
global $wp_the_query;
if ( ($wp_the_query === $query) && (is_search()) && ( ! is_admin()) ) {
$query->set(
'meta_query',
array(
array(
'key' => '_wp_page_template',
'value' => 'members.php',
'compare' => '!='
)
)
);
}
}
add_filter('pre_get_posts','exclude_page_templates_from_search');

That’s it, your done. Now if you find members content in your search results, you can click on these pages and change them to use the Members template and they will not appear in the search results again.