• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • Presentations and Interviews
    • on GitHub →
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • WordPress Plugins

Stephanie Leary

Writer, Front End Developer, former WordPress consultant

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

Closing old comment threads and dealing with spam

November 5, 2003 Stephanie Leary

Some of you may have noticed the atrocious comment spam that’s been popping up here lately. I’ve deleted the comments as I’ve found them, but the spammers are finding old comment threads and flooding them with junk.

When the new version of MT came out, I upgraded, but didn’t do anything about the new feature that lets you close old comment threads. I’ve just closed all but a handful. Rather than do it by hand for 450+ entries, I used a little SQL that I’m sharing here for those who don’t deal with databases on a regular basis:

update mt_entry set entry_allow_comments = 2 where entry_blog_id = 1;

This closes all comment threads in the blog whose ID is 1. (To find out what your blog ID is, check the URL while you’re managing your blog. You should see “&blog_id=[number]” somewhere toward the end.)

To reopen the comments on your last few posts, find the entry ID (again, check the URL) of the earliest one you want comments on, and then use this:

update mt_entry set entry_allow_comments = 1 where entry_blog_id = 1 and entry_id > #;

where # is the entry ID you found. Or, you can find that ID before you run the first command, and do it in one step:

update mt_entry set entry_allow_comments = 2 where entry_blog_id = 1 and entry_id < #;

You can reopen the comments on a single old post by doing something like this:

update mt_entry set entry_allow_comments = 1 where entry_blog_id = 1 and entry_id = 258;

You’ll need to rebuild when you’re done. And when you’re done you can, like me, put installing MT-Blacklist on your weekend to-do list.

Blogging

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2025 Stephanie Leary · Contact