Quick Comment Moderation in Thesis

The fol­low­ing is tai­lored to Word­Press blogs which are enhanced with the The­sis theme frame­work.

It seems like quite a few blog­gers out there pre­fer to man­age their com­ments via the front-end, reply­ing to and edit­ing com­ments right from the post page itself.

I per­son­al­ly find it a lot eas­i­er to browse to the Man­age → Com­ments admin­is­tra­tion pan­el, but if that just isn’t your thing or if you would just like to have quick­er access to com­ment mod­er­a­tion, you can spice up your com­ments a bit by using this bit of code: 

function extra_comment_moderation() {
	if (current_user_can('edit_post') && thesis_get_option('edit_comment_link')) {
		echo '<p><span class="delete_comment">[ <a href="', admin_url('comment.php?action=cdc&amp;c=');
		echo '">delete</a> ]</span>';
		echo ' <span class="spam_comment">[ <a href="', admin_url('comment.php?action=cdc&amp;dt=spam&amp;c=');
		echo '">spam</a> ]</span>';
add_action('thesis_hook_after_comment', 'extra_comment_moderation');

Add that code to your thesis/custom/custom_functions.php file, turn on the “show edit com­ments link” in the Design → The­sis Options admin­is­tra­tion pan­el, and then view one of your blog posts which has comments.

Pro­vid­ed you have the appro­pri­ate lev­el of per­mis­sions (i.e., you can edit the post you’re view­ing), you should see two new links in the foot­er of com­ments: “[ spam ]” and “[ delete ]”.

Now, while you’re brows­ing your blog, if you notice a com­ment which should­n’t be there, you can take care of it direct­ly from the post page itself, sav­ing you from need­ing to browse to the admin­is­tra­tion area.

Also, note that acci­den­tal clicks will not delete or mark com­ments as spam; fol­low­ing either link will take you to a con­fir­ma­tion page. Handy, no?

This tuto­r­i­al is con­firmed work­ing in The­sis 1.3.2.

Leave a Comment

Your email address will not be published.

Use your Gravatar-enabled email address while commenting to automatically enhance your comment with some of Gravatar's open profile data.

Comments must be made in accordance with the comment policy. This site uses Akismet to reduce spam; learn how your comment data is processed.

You may use Markdown to format your comments; additionally, these HTML tags and attributes may be used: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Rick Beckman