Warning: Creating default object from empty value in /home/design/public_html/wp-content/plugins/paged-comments/paged-comments.php on line 31
Specify the user level needed to skip comment moderation in WordPress · Dagon Design

Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Friday, February 20th, 2009 at 8:20pm

Specify the user level needed to skip comment moderation in WordPress

This simple WordPress hack allows you to specify the minimum user level needed to post comments without moderation. By default, WordPress allows administrators (and the author of the post) to skip moderation checks when posting comments, but it is easy to adjust this so that you can choose the user level yourself. This can be useful for those of you who have strict comment moderation enabled (manual comment approval), as it allows you to let registered users of your site post immediately without having to wait for approval.


This code modification has been verified to work in WordPress versions 2.1 through 2.8+


Open wp-includes/comment.php

For WordPress 2.1 through 2.7.x, Find the following code:

if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') 
) ) {
  // The author and the admins get respect.
  $approved = 1;

For WordPress 2.8, Find the following code:

if ( isset($userdata) && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
  // The author and the admins get respect.
  $approved = 1;

Then simply change level_9 to whatever user level you want. All users at or above the selected level will be able to post comments without requiring manual approval (if you have manual approval enabled).

For a complete list of the user levels, and their roles, please see this page from the WordPress codex: http://codex.wordpress.org/Roles_and_Capabilities

  If you have found this page useful, please consider donating. Thanks!

Pages: [10] 9 8 7 6 5 4 3 2 1 » Show All

  1. You’re so cool! I don’t think I’ve read anything like this before. Thanks for your personal marvelous posting! I actually enjoyed reading it, you will be a great author. I will always bookmark your blog and will often come back in the future.

  2. This is really a fascinating blog, lots of stuff that I can get into. One thing I just want to say is that your design is so perfect! Afrer reading your post i could understand that the content is most simple and great. Thank you for your great share. Also this is my 1st visit at your site and after visiting your site i enjoyed.

  3. I was about to say something on this topic. But now i can see that everything on this topic is very amazing and mind blowing, so i have nothing to say here. I am just going through all the topics and being appreciated. Thanks for sharing.

  4. WordPress is what I often used. Like writing work dairy, managing my personal blog. Therefore this article is very useful to me. Thanks.

  5. thanks so much for the tips,
    very useful for me because i’m not good for coding..

  6. One other issue is that if you are in a circumstances where you do not have a cosigner then you may genuinely wish to try to make use of all of your money for college options. You’ll find many grants and other scholarships or grants that will ensure that you get funds to aid with university expenses. Thanks alot : ) for the post.

  7. A big thank you for your post WordPress. Really looking forward to read more. Really Great.

  8. Now everybody know about WordPress. And everybody love it. I simply want to tell you that I’m new to blogging and honestly loved your web blog. Probably I’m going to bookmark your blog . You definitely have great article content. Many thanks for revealing your blog.

  9. Another great feature of this plugin is the useful ability to monitor the review status of newly submitted articles right from the WordPress administrative interface.

  10. Thanks for another informative blog. Where else could I am getting that type of info
    written in such an ideal manner? I have a project that
    I’m just now running on, and I’ve been at the look out for such information.

  11. Nice details, I stumbled upon your current publish definitely valuable. The idea aided myself entirely within doing our job. We are furthermore presenting some sort of research url of one’s weblog during my example. Thanks pertaining to posting like educational written content.

Pages: [10] 9 8 7 6 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.

Be sure to wrap all code in <code></code> tags.