Today I got asked by a client to investigate a problem with their WordPress blog. A particular blog post of theirs was not allowing any more comments and they didn’t even notice that the page was no longer rendering correctly, but as the site developer I noticed that first off. They asked if there was a limit to the number of comments allowed in WordPress. So I Googled and found in my research that even WordPress stated that there was no inherit limit to the number of comments allowed. No one I came across had written that they ran into a limit or that their post was broken after a certain number of comments.
This blog post my client was asking me about had over 20,000 comments and all of them were legitimate. The blog author had asked people to share their favorite bible verse and this is a very well known Christian author’s blog. Since I hadn’t read that there was a limit to the number of comments, I reasoned that it must be some bad code in a particular comment, so I started out by unapproving the last batch of 100 comments they had approved. This resulted in the comment form being back and the page rendering correctly again. So I started approving comments again in batches of 10 until the page broke again.
When I got the broken result again, I unapproved the batch I had just approved and tried approving a different batch of 10 again. The page broke again, so then I unapproved those 10 again and approved one at a time until the site broke again… finally arriving at a final number of comments that this WordPress site would allow before it broke. The final number was 21,583.
My co-workers and I are curious if anyone else has run into this before, perhaps with a different number. We aren’t sure if there’s a limit to the size of the database field for comments in a blog post or if it really has to do with the number of comments. Perhaps it’s a limitation of the server or memory partition size – who knows! We’d love to get some feedback from anyone who knows.