How to Add ‘Edit All Comments’ Link to WordPress Posts

By 2 years ago   BloggingWordPress
Tweet Share Email Share  

How do you edit all 100 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.

Just as front end editing makes editing faster – 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!

Edit All Comments

Traditionally you need to go to WordPress admin > All Post > Post > Comments Count Link.

comments count

Clicking on the comments takes you to the ALL Comments Edit Screen, where you can moderate comments quickly and deal with spam comments faster.

comments edit screen

Edit All Comments Link

I wanted to share a screenshot of what I see when I view the post.

edit comments link

Normal site visitors will not see those 2 buttons to ‘Edit Current Post’ and ‘Edit All Comments’ – it is only visible to logged in Admins on our site.

Here is the code we use

if (is_user_logged_in() || current_user_can('edit_post')) { 

<a  href="<?php the_ID(); ?>&amp;action=edit">Edit Current Post</a>

<a href="<?php the_ID(); ?>" target="_blank">Edit All Comments</a>

<?php } ?>

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 adds the ‘Edit All Comments” link.

Where to add the code? You can add it to the single.php or content.php file, depending of your WordPress theme, where you want the code to appear.

How did we make those cool buttons? They are made easily with Bootstrap theme and Font Awesome – both essential elements of modern web design.

5 comments on “How to Add ‘Edit All Comments’ Link to WordPress Posts

  1. Ryan Biddulph says:

    Nice option P which saves us a bunch of time. Thanks!

  2. Hello dude, what code or plugins you’re using, incredible load speed of ur site?

  3. Akshat Verma says:

    Very handy and saves my time editing comments. Thanks for this tutorial.

  4. Really helpful post for wordpress users. Thanks a lot for sharing.

  5. Fahim Zada says:

    It’s help me thankx for the post thumbs up for writer i will keep visiting for new staff great web :)

Leave a Reply

Your email address will not be published. Required fields are marked *

ALL comments are moderated. No links allowed. Use real name. Only useful comments will be approved.