How to disable comments on posts older than date X in WordPress

To disable comments on posts older than date X in WordPress you can use the snippet below.

Sample mySQL

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

Please Share us:
Please rate this snippet

3 thoughts on “How to disable comments on posts older than date X in WordPress

Leave a Reply