I’ve recently been under heavy comment spam, and along with taking preventive steps to keep the spam from occurring ( posts are now moderated ), I also built an admin page to allow me to mass-delete comments:

image

Right now it’s just a simple aspx page w/ code-behind, all you need to do is drop it into the /admin/pages directory of your site, and if you’re logged in as an admin, you’ll be able to access it by going to http://www.yoursiteurl/admin/pages/CommentManager.aspx

The page files can be downloaded here.

Depending upon how you have your site configured, you may need to set the web.config to compile under 3.5, which can be done by adding the following to your web.config, nested directly in the <configuration> section:

<system.codedom>
  <
compilers>
    <
compilerlanguage="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,
              System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
"
              warningLevel="4">
      <
providerOption name="CompilerVersion" value="v3.5"/>
      <
providerOption name="WarnAsError" value="false"/>
    </
compiler>
    <
compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
              type="Microsoft.VisualBasic.VBCodeProvider, System,
              Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
"
              warningLevel="4">
      <
providerOption name="CompilerVersion" value="v3.5"/>
      <
providerOption name="OptionInfer" value="true"/>
      <
providerOption name="WarnAsError" value="false"/>
    </
compiler>
  </
compilers>
</
system.codedom>
<
runtime>
  <
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <
dependentAssembly>
      <
assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
      <
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </
dependentAssembly>
    <
dependentAssembly>
      <
assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
      <
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </
dependentAssembly>
  </
assemblyBinding>
</
runtime>

If anyone is interested in using the comment manager as a plugin, let me know, it’d be a fun exercise to go through ( and blog about! ).

- Colin