Posted on Mar 04, 2008 - 1:14am by John P. in Wordpress
Folks, I get a lot of comments here on One Man’s Blog (nearly 7,000 at this point). Often there are well over 20 between times I check, even within one day, but the standard page view in the Edit Comments administration page only shows 20 thereby causing me to scroll from page to page in order to view / moderate more comments.
So, I just hacked mine to show 50 per page instead. Here is how you go about it.
$start = $offset = ( $page - 1 ) * 20;
list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 25 ); // Grab a few extra
$comments = array_slice($_comments, 0, 20);
$extra_comments = array_slice($_comments, 20);$page_links = paginate_links( array(
‘base’ => add_query_arg( ‘apage’, ‘%#%’ ),
‘format’ => ”,
‘total’ => ceil($total / 20),
‘current’ => $page
));
$start = $offset = ( $page - 1 ) * 50;
list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 55 ); // Grab a few extra
$comments = array_slice($_comments, 0, 50);
$extra_comments = array_slice($_comments, 50);$page_links = paginate_links( array(
‘base’ => add_query_arg( ‘apage’, ‘%#%’ ),
‘format’ => ”,
‘total’ => ceil($total / 50),
‘current’ => $page
));
The good news is, this works perfectly. The bad news is, you’re going to have to redo this every time you update WordPress until we finally get a selection menu baked into the core.
I use the "No Adverts for Friends" plugin by Donncha O Caoimh
Sir John,
thank you for that, just did it, now I just need that much comments… hehe
cheers
Rhoody
Good idea John. Haven’t had any big hitting stories recently, but a few months ago I had one on animal abuse that is still popular (almost 600 comments or so?) and while they trickle in now, when it was posted, I was doing the same..
While I’m in that code, I’d also recommend modifying Akismnet (however it’s spelled lol), to trim the comment to only the first 300 characters or so. When checking for false positives it’s tedious because some of the comment spam that gets caught is hundreds of links in a single post.
Bookmarked
Thanks alot john i love your tutorials they are amazing simple understand able just few lines of code and it is done. Wow you rock Sir
[...] Mans Blog explains How to Increase the Number of Comments in the WordPress Editor. This can also easily be covered with a WordPress Greasemonkey [...]
This may seem like an odd question….I’m fairly new to blogging. Why would you want to have more than 20 comments showing? Won’t lots of comments on each article eventually make your blog tough to scroll through? And if you want more than 20, is 50 the max you consider putting in there?
I like the idea of shortening the number of chars that show up. It would assist with some of the scrolling issues, along with giving your readers the opportunity to select from more comments, and then select the ones that they want to get complete details on.
Thanks for the great info you provide!
Debi J
Debi,
This modification only affects the number of comments that show up on the back end of the blog in the administration page. Your theme and plugins will affect the number that show up on the actual blog for readers. By default ALL comments will show up on the same page, so I use the threaded comments plugin to show only about 25 at a time to my readers.
You can see my entire list of plugins here.
John