Approve Link for Comments
One of the ‘last-straw’ ways to deal with spam in ExpressionEngine is enabling Comment Moderation, wherein each comment submitted to the site has to be approved by an administrator before appearing. Admins are notified of new comments via email - and that email can contain a “Delete Comment” link using a built-in EE variable. There is, however, no matching variable for “Approve Comment”.
This makes the process for approving a new comment harder than deleting - which just shouldn’t be the case. We’re going to be positive here, right?
Turns out this is pretty easy to get around with the following code snippet. This would go in your Admin Notification of Comments template which is found under: Admin › Specialty Templates › Email Notification Templates.
Approve?
PATH TO YOUR CP HERE?S=0&C=edit&M=change_status&comment_id={comment_id}&status=open
or:
Approve?
http://www.yoursite.com/system/index.php?S=0&C=edit&M=change_status&comment_id={comment_id}&status=open
When you or your Admin clicks the Approve link they will be taken to the EE Control Panel view of the list of comments for this particular entry. The nice thing is if the “Approve” link was clicked by mistake the option to close or delete the comment is right there as well.
Category Navigation






by Erik Reagan
Date: Tuesday, November 3rd, 2009
Comment: #1
Thanks for the tip Mike! I was wondering about this while planning out a current project and just hadn’t made it far enough to look into it. Now you’ve provided the answer (no surprise there).
The only downside is that you have to be logged in for this link to work. It would be nice if EE had a way of remembering what CP page was clicked to and redirected after a successful log in. As far as I know this does not occur by default. Any thoughts?
Thanks again! :)