Quick Comment Moderation in Thesis

The following is tailored to WordPress blogs which are enhanced with the Thesis theme framework.

It seems like quite a few bloggers out there prefer to manage their comments via the front-end, replying to and editing comments right from the post page itself.

I personally find it a lot easier to browse to the Manage → Comments administration panel, but if that just isn’t your thing or if you would just like to have quicker access to comment moderation, you can spice up your comments 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=');
		comment_ID();
		echo '">delete</a> ]</span>';
		echo ' <span class="spam_comment">[ <a href="', admin_url('comment.php?action=cdc&amp;dt=spam&amp;c=');
		comment_ID();
		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 comments link” in the Design → Thesis Options administration panel, and then view one of your blog posts which has comments.

Provided you have the appropriate level of permissions (i.e., you can edit the post you’re viewing), you should see two new links in the footer of comments: “[ spam ]” and “[ delete ]”.

Now, while you’re browsing your blog, if you notice a comment which shouldn’t be there, you can take care of it directly from the post page itself, saving you from needing to browse to the administration area.

Also, note that accidental clicks will not delete or mark comments as spam; following either link will take you to a confirmation page. Handy, no?

This tutorial is confirmed working in Thesis 1.3.2.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

the Rick Beckman archive
Scroll to Top