{"id":3862,"date":"2020-05-26T06:43:07","date_gmt":"2020-05-26T06:43:07","guid":{"rendered":"https:\/\/demos.welaunch.io\/helpdesk\/?post_type=faq&#038;p=3862"},"modified":"2020-07-31T13:42:52","modified_gmt":"2020-07-31T11:42:52","slug":"can-i-disable-faq-comments","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/can-i-disable-faq-comments\/","title":{"rendered":"How to disable FAQ comments"},"content":{"rendered":"<p>To disable comments in general, go to your wp-admin panel. Then open Settings &gt; Discussions. There you can disable &#8220;allow people to submit comments on new posts&#8221;.<\/p>\n<p>If you only want to disable comments for certain FAQs, then open a post and see discussions box. There you can uncheck &#8220;Allow Comments&#8221;.<\/p>\n<figure id=\"attachment_5779\" aria-describedby=\"caption-attachment-5779\" style=\"width: 808px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5779\" src=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post.png\" alt=\"disable wp comments for single post\" width=\"808\" height=\"256\" srcset=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post.png 808w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post-247x78.png 247w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post-510x162.png 510w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post-300x95.png 300w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2020\/05\/disable-wp-comments-for-single-post-768x243.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><figcaption id=\"caption-attachment-5779\" class=\"wp-caption-text\">disable wp comments for single post<\/figcaption><\/figure>\n<p>You can also disable comments for all frequently asked question post types. Simply put the following code into your functions.php file.<\/p>\n<pre>function disable_comments_for_faq_post_types( $open, $post_id ) {\r\n    $post_type = get_post_type( $post_id );\r\n    \/\/ disable comments for built-in \"faq\" post type\r\n    if ( $post_type == 'faq' ) {\r\n        return false;\r\n    }\r\n    \/\/ enable comments for any other post types\r\n    return true;\r\n}\r\nadd_filter( 'comments_open', 'disable_comments_for_faq_post_types', 10 , 2 );\r\n<\/pre>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-3862","faq","type-faq","status-publish","hentry","faq_topics-helpdesk-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/3862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=3862"}],"version-history":[{"count":3,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/3862\/revisions"}],"predecessor-version":[{"id":5781,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/3862\/revisions\/5781"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=3862"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=3862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}