{"id":1725,"date":"2006-10-03T20:54:25","date_gmt":"2006-10-03T15:24:25","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/2006\/10\/automatically-close-comments-in-wordpress-after-few-days\/"},"modified":"2013-02-02T22:14:59","modified_gmt":"2013-02-02T16:44:59","slug":"automatically-close-comments-in-wordpress-after-few-days","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2006\/10\/automatically-close-comments-in-wordpress-after-few-days\/","title":{"rendered":"Automatically Close Comments in WordPress After Few Days"},"content":{"rendered":"<p>You type a controversial post, you get a flurry of comments and they keep coming as your post is digged, slashdotted &#8230; and then after a few days the post is forgotten in the archives to be picked up a year later by an occasional Googler, who decides to leave a comment, that features now in your recent comments in the sidebar and restarts the <strong>comment boom on an outdated, not-to-be-discussed now post<\/strong>. Remember many people look at the post date of an actively discussed article <em>after <\/em>the comment is posted and live and they have no way to change it.<\/p>\n<p>A simple way to do it is to <strong>simply turn off comments in an individual post<\/strong>. But doing it to hundreds of posts after a period of time is difficult, especially if you are a popular quick posting blogger. <\/p>\n<p>I found this Auto Shutoff Comments wordpress plugin on the official wordpress codex. It is a raw text code which you paste in any text editor like notepad in Windows and save as <strong>autoshutoff.php<\/strong>, then simply upload to your WordPress plugin folders and activate it. It will <strong>autoclose comments after 21 days<\/strong>. I think you can change the number of days it closes by tweaking the 21 value.<\/p>\n<p><code> \/\/ Set $age to the age at which a post should become stale<br \/>\n    $age = '21 DAY';<\/code><\/p>\n<p>I have no need to use it now, but if you are looking for a simple solution to close off comments after a few days automatically, give it a try. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You type a controversial post, you get a flurry of comments and they keep coming as your post is digged,&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[17],"class_list":["post-1725","post","type-post","status-publish","format-standard","hentry","category-blogging","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=1725"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1725\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=1725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=1725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=1725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}