WordPress – Allow Users to Edit their Comments

How many times you have felt the need to edit a comment you just left on a site? Maybe you want to correct a spelling or grammar error, or maybe you just regret saying something silly. It happens to all of us. Except most sites do not allow users to edit their comments once it is published. If you run an active site with a lot of comments, then you may have considered allowing users to edit their own comments. In this article, we will show you how to allow users to edit their comments in WordPress for a short period of time.

If your site has registered users, then you can easily leverage the built-in user roles and capabilities to allow some users the ability to edit their own comments. The problem is that most sites do not require users to register before commenting. By default WordPress sites have open comments for anyone who provides a name and email. So here is how you can allow non-registered users to edit their own comments for a short period of time (default is 5 minutes).

First thing you need to do is install and activate the Simple Comment Editing plugin. Upon activation the plugin allows anonymous users the ability to edit their comments after sending it.

By default the user can only edit their comments for the first 5 minutes. After that, the user is not able to edit their comment. If you want to change this time period, then this plugin allows you to do so using a filter. Simply add the following code in your theme’s functions.php file or in a site-specific plugin like this:

1 add_filter( 'sce_comment_time''edit_sce_comment_time' );
2 function edit_sce_comment_time( $time_in_minutes ) {
3     return 10;
4 }

In this code above, we have simply increased the time limit set by the plugin to 10 minutes however you can modify it to anything else that you like. Since the purpose is to allow users to fix small grammatical errors or taking back something right away, in our opinion it is best to not to set the limit higher than 30 minutes.

Simple Comment Edits is a stripped down version of ajax editing comments to make it easy for new users to get started and going without dealing with any settings. This plugin works out of the box. If you don’t want to modify the default time limit, then there is no settings you need to fiddle with. We love plugins like this that are plug and play.

We hope that this article helped in allowing anonymous users to edit their own comments in WordPress for a short period of time. What do you think about this feature? Is it useful? Would you put it on your site? Let us know by leaving a comment below.

Looking for quality WordPress Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under WordPress | RSS 2.0

Author Spotlight

TJ Marsh

My name is Tj Marsh. I spend about 16 hours a day on the internet. Running my company and helping out here at Arvixe. I live in the good ole Arizona where it gets ridiculously hot. I love WordPress and a lot of other open source software along with coding.

Leave a Reply

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