WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some posts in my wordpress isntallation display comments closed, while some are open. Did this happen because while writing those posts comments was closed and now as it is open value in db remained unchanged?

If so is there a massive way to fix this?

share|improve this question
Although it doesn't seem a duplicate, there are plenty of similar questions at the Related right column that should answer this. Also, I suspect you and the Codex are not friends yet :) – brasofilo Jul 29 '12 at 11:29
@brasofilo ty for the codex link that explains allot. – Sandro Dzneladze Jul 29 '12 at 11:57
cool, in many occasions, instead of waiting for an answer, you'll find that the solution has already been Codexified – brasofilo Jul 29 '12 at 11:59

Sql can help you out alot with this:

An Excerpt from Jeff Star.

Disabling and enabling comments

In the WordPress database, the “wp_posts” table includes a column called “comment_status”, which may contain one of the following values for each row (i.e., post):

open (comments open to everyone) closed (comments closed to everyone) registered_only (comments open for registered/logged-in users) Given this information, we may execute the following SQL queries (via phpMyAdmin or any other method of querying the database) to manipulate our discussion-management settings for comments (note: remember to backup your database):

Globally enable comments for all users

UPDATE wp_posts SET comment_status = 'open'; 

Globally disable comments for all users

UPDATE wp_posts SET comment_status = 'closed'; 

Globally enable comments for registered users only

UPDATE wp_posts SET comment_status = 'registered_only'; 

Globally enable/disable comments before a certain date

For this query, specify the comment_status as either open, closed, or registered_only. Also, specify the date by editing the 2008-01-01 to suit your needs.

UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2008-01-01' AND post_status = 'publish';

I run this query a few times each year (or as often as I can remember it) to disable comments on old posts. Ultimately, I will combine this query with a similar one (provided below) for pingbacks and trackbacks to manage discussion options with a single step.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.