{"id":250,"date":"2020-06-09T07:05:36","date_gmt":"2020-06-09T07:05:36","guid":{"rendered":"https:\/\/codexjunction.com\/?p=250"},"modified":"2023-10-29T17:00:33","modified_gmt":"2023-10-29T17:00:33","slug":"remove-comment-form-in-wordpress-single-post","status":"publish","type":"post","link":"https:\/\/codexjunction.com\/remove-comment-form-in-wordpress-single-post\/","title":{"rendered":"Remove Comment Form in WordPress Single Post"},"content":{"rendered":"<div class=\"cdk-visually-hidden cdk-focus-trap-anchor\" tabindex=\"0\" aria-hidden=\"true\"><span style=\"font-size: 1.21429rem;\">To remove the comment form in a WordPress single post, you can use one of the following methods:<\/span><\/div>\n<div class=\"response-container-content ng-tns-c628290711-128\">\n<div class=\"response-content ng-trigger ng-trigger-responsePopulation ng-tns-c628290711-128\">\n<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<p data-sourcepos=\"3:1-3:43\"><strong>Method 1: Using the WordPress dashboard<\/strong><\/p>\n<ol data-sourcepos=\"5:1-9:0\">\n<li data-sourcepos=\"5:1-5:35\">Go to\u00a0<strong>Posts<\/strong>\u00a0&gt;\u00a0<strong>All Posts<\/strong>.<\/li>\n<li data-sourcepos=\"6:1-6:76\">Click on the title of the post where you want to remove the comment form.<\/li>\n<li data-sourcepos=\"7:1-7:72\">Under the\u00a0<strong>Discussion<\/strong>\u00a0section, uncheck the\u00a0<strong>Allow comments<\/strong>\u00a0box.<\/li>\n<li data-sourcepos=\"8:1-9:0\">Click the\u00a0<strong>Update<\/strong>\u00a0button.<\/li>\n<\/ol>\n<p data-sourcepos=\"10:1-10:39\"><strong>Method 2: Editing the post template<\/strong><\/p>\n<ol data-sourcepos=\"12:1-14:0\">\n<li data-sourcepos=\"12:1-12:103\">Open the post template file for the post where you want to remove the comment form in a text editor.<\/li>\n<li data-sourcepos=\"13:1-14:0\">Locate the following code:<\/li>\n<\/ol>\n<div class=\"code-block ng-star-inserted\">\n<div class=\"code-block-decoration header gmat-subhead-2 ng-star-inserted\">PHP<\/div>\n<pre><code class=\"code-container\" role=\"text\"><span class=\"hljs-meta\"><span class=\"citation-0\">&lt;?php<\/span><\/span> <span class=\"hljs-keyword\"><span class=\"citation-0\">if<\/span><\/span><span class=\"citation-0\"> ( comments_open() || get_comments_number() ) : <\/span><span class=\"hljs-meta\"><span class=\"citation-0\">?&gt;<\/span><\/span>\r\n  <span class=\"hljs-meta\"><span class=\"citation-0\">&lt;?php<\/span><\/span><span class=\"citation-0\"> comments_template(); <\/span><span class=\"hljs-meta\"><span class=\"citation-0\">?&gt;<\/span><\/span>\r\n<span class=\"hljs-meta\"><span class=\"citation-0\">&lt;?php<\/span><\/span> <span class=\"hljs-keyword\"><span class=\"citation-0\">endif<\/span><\/span><span class=\"citation-0\">; <\/span><span class=\"hljs-meta\"><span class=\"citation-0\">?&gt;<\/span><\/span>\r\n<\/code><\/pre>\n<\/div>\n<ol start=\"3\" data-sourcepos=\"21:1-23:0\">\n<li data-sourcepos=\"21:1-21:32\"><span class=\"citation-0\">Delete the entire code block.<\/span><\/li>\n<li data-sourcepos=\"22:1-23:0\"><span class=\"citation-0 citation-end-0\">Save the file and upload it back to your <a href=\"https:\/\/www.hostinger.in\/tutorials\/install-wordpress-locally\" rel=\"nofollow\">WordPress installation<\/a>.<\/span><\/li>\n<\/ol>\n<p data-sourcepos=\"24:1-24:38\"><strong>Method 3: Using a WordPress plugin<\/strong><\/p>\n<p data-sourcepos=\"26:1-26:140\">There are also a number of WordPress plugins that can be used to remove the comment form. One popular plugin is called <strong>Disable Comments<\/strong>.<\/p>\n<p data-sourcepos=\"28:1-28:19\">To use this plugin:<\/p>\n<ol data-sourcepos=\"30:1-34:0\">\n<li data-sourcepos=\"30:1-30:35\">Install and activate the plugin.<\/li>\n<li data-sourcepos=\"31:1-31:45\">Go to\u00a0<strong>Settings<\/strong>\u00a0&gt;\u00a0<strong>Disable Comments<\/strong>.<\/li>\n<li data-sourcepos=\"32:1-32:60\">Select the post types where you want to disable comments.<\/li>\n<li data-sourcepos=\"33:1-34:0\">Click the\u00a0<strong>Save Changes<\/strong>\u00a0button.<\/li>\n<\/ol>\n<p data-sourcepos=\"35:1-35:103\">Once you have followed one of the above methods, the comment form will be removed from the single post.<\/p>\n<p data-sourcepos=\"37:1-37:203\">Please note that removing the comment form will prevent users from commenting on the post. If you are unsure whether or not to remove the comment form, you may want to consult with a <a href=\"https:\/\/codexjunction.com\/find-and-replace-wordpress-plugins\/\">WordPress developer<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>To remove the comment form in a WordPress single post, you can use one of the following methods: Method 1: Using the WordPress dashboard Go to\u00a0Posts\u00a0&gt;\u00a0All Posts. Click on the title of the post where you want to remove the comment form. Under the\u00a0Discussion\u00a0section, uncheck the\u00a0Allow comments\u00a0box. Click the\u00a0Update\u00a0button. Method 2: Editing the post template Open the post template file for the post where you want to remove the comment form in a text editor. Locate the following code: PHP &lt;?php if ( comments_open() || get_comments_number() ) : ?&gt; &lt;?php comments_template(); ?&gt; &lt;?php endif; ?&gt; Delete the entire code block. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":283,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[512,508,510,511,509,262],"class_list":["post-250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-a-online-course-web-tutorial","tag-learn-java-online","tag-learn-laravel-online","tag-learn-php-online","tag-learn-python-online","tag-remove-comment-form"],"_links":{"self":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":4,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":2670,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/posts\/250\/revisions\/2670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/media\/283"}],"wp:attachment":[{"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codexjunction.com\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}