Tired of Comment Spam?

Do you have comments on your SharePoint blog activated? Anonymous users may leave comments which you have to approve for them to show up? Good.

The problem is that there are plenty spam posts which I don’t want to sort out manually.

Here comes my solution:

The RH.NoBlogCommentSpam SharePoint solution.

What does it do?

  • Approve comments from non anonymous users (you can decide if logged in users, may post links)
  • Recycle posts with comments in the subject / body (you can decide)
  • Approve comments from anonymous if they do not contain links

Requirements

make sure you read them carefully!

  1. There are changes to the execute permissions on some procs required
  2. The account which runs the application pool needs some extra rights
</div>

  1. needs to be a farm administrator 
  2. Modify Access to C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config 

Requirement 1

There are 4 stored procedures which the application pool account needs execute permission in order to store values in the SPWebApplication.Properties. This is the place I store the information on which list we need to check for comment spam.

You can copy this SQL Query and execute it on your SQL Server. Make sure you adjust the name of your Config Database!

use [SharePoint_Config]

GO

GRANT EXECUTE ON [dbo].[proc_putObject] TO [WSS_Content_Application_Pools]

GO

GRANT EXECUTE ON [dbo].[proc_putClass] TO [WSS_Content_Application_Pools]

GO

GRANT EXECUTE ON [dbo].[proc_dropObject] TO [WSS_Content_Application_Pools]

GO

GRANT EXECUTE ON [dbo].[proc_getNewObjects] TO [WSS_Content_Application_Pools]

GO

Requirement 2.1

Go to the central administration of your SharePoint Farm. Then add the application pool account which is used for your blog comment list to the farm administrator group.

Requirement 2.2

Grant your WSS_WPG Group Modify Access to the folder beneath “C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config”

Installation

After you have completed all steps above, you can add the solution and activate it on your webapplication.

Activate feature on the webapplication

Activate the feature on your site

Configure your comment list

Now you are ready to configure the comment list for your blog, where you want the spam to vanish through my solution.

Set the properties according your needs:

Finally you are done. A timer job will run every 5 minutes to check this comment list for spam, and recycle the comments to the site collection recycle bin.

After a while your recycle bin might look like mine. (There are more comments in it J )

Download RH.NoBlogCommentSpam Solution

Download SharePoint Solution RH.NoBlogCommentSpam.wsp