Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
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
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.