{"id":40948,"date":"2014-06-02T18:28:03","date_gmt":"2014-06-02T12:58:03","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=40948"},"modified":"2020-07-01T12:22:32","modified_gmt":"2020-07-01T06:52:32","slug":"edit-all-comments-link-to-wordpress-posts","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2014\/06\/edit-all-comments-link-to-wordpress-posts\/","title":{"rendered":"How to Add &#8216;Edit All Comments&#8217; Link to WordPress Posts"},"content":{"rendered":"<p>How do you edit all\u00a0100 comments on your WordPress posts? Probably you go to the WordPress Admin to find the post, then see the number of comments beside the post, then click it to see the screen to edit all the comments on the posts. Or you click the single Edit link beside each comment individually.<\/p>\n<p>Just as <a title=\"Best Way to Edit Live Posts Inline Without WordPress Admin\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/05\/barley-inline-editing-live-posts\/\">front end editing<\/a> makes editing faster &#8211; would it not be easier if there was a link which would take WordPress admin\/editors directly from the web page to the ALL comments moderation screen. We added this code is our WordPress theme which allows logged in admins to reach the comment moderation links in one click!<\/p>\n<h2>Edit All Comments<\/h2>\n<p>Traditionally you need to go to WordPress admin &gt; All Post &gt; Post &gt; Comments Count Link.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-40949\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-count.png\" alt=\"comments count\" width=\"363\" height=\"196\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-count.png 363w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-count-150x80.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-count-300x161.png 300w\" sizes=\"(max-width: 363px) 100vw, 363px\" \/><\/p>\n<p>Clicking on the comments takes you to the ALL Comments Edit Screen, where you can <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/moderate-wordpress-comments-quickly\/\" >moderate comments quickly<\/a> and deal with spam comments faster.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-40950\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-edit.png\" alt=\"comments edit screen\" width=\"500\" height=\"399\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-edit.png 500w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-edit-150x119.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-edit-300x239.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<h3>Edit All Comments Link<\/h3>\n<p>I wanted to share a screenshot of what I see when I view the post.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-40951\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-comments-link.png\" alt=\"edit comments link\" width=\"439\" height=\"260\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-comments-link.png 439w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-comments-link-150x88.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-comments-link-300x177.png 300w\" sizes=\"(max-width: 439px) 100vw, 439px\" \/><\/p>\n<p>Normal site visitors will not see those 2 buttons to &#8216;Edit Current Post&#8217; and &#8216;Edit All Comments&#8217; &#8211; it is only visible to logged in Admins on our site.<\/p>\n<p><strong>Here is the code we use<\/strong><\/p>\n<pre><code>&lt;?php \r\nif (is_user_logged_in() || current_user_can('edit_post')) { \r\n?&gt;\r\n\r\n&lt;a \u00a0href=\"https:\/\/www.quickonlinetips.com\/archives\/wp-admin\/post.php?post=&lt;?php the_ID(); ?&gt;&amp;amp;action=edit\"&gt;Edit Current Post&lt;\/a&gt;\r\n\r\n&lt;a href=\"https:\/\/www.quickonlinetips.com\/archives\/wp-admin\/edit-comments.php?p=&lt;?php the_ID(); ?&gt;\" target=\"_blank\"&gt;Edit All Comments&lt;\/a&gt;\r\n\r\n&lt;?php } ?&gt;<\/code><\/pre>\n<p>The first line checks to see the user is logged in and has rights to edit the post. Then next is the Edit Post button which you probably already have in your theme at some place. The next code\u00a0adds the &#8216;Edit All Comments&#8221; link.<\/p>\n<p><strong>Where to add the code?<\/strong> You can add it to the single.php or content.php file, depending of your WordPress theme, where you want the code to appear.<\/p>\n<p><strong>How did we make those cool buttons?<\/strong> They are made easily with <a title=\"Use Twitter Bootstrap for Powerful Web Design\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/twitter-bootstrap\/\">Bootstrap<\/a> theme and <a title=\"How to Add Font Awesome Icons in Bootstrap\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/07\/font-awesome-icons-in-bootstrap\/\">Font Awesome<\/a> &#8211; both essential elements of <a title=\"5 Essential Web Design Elements You Must Use\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/09\/essential-web-design-elements\/\">modern web design<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do you edit all\u00a0100 comments on your WordPress posts? Probably you go to the WordPress Admin to find the&#8230;<\/p>\n","protected":false},"author":4,"featured_media":40951,"comment_status":"open","ping_status":"closed","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":[49,17],"class_list":["post-40948","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/40948","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=40948"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/40948\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/40951"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=40948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=40948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=40948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}