Learned how to remove Post Author comments from Recent Comments Widget
Published on February 1, 2017
Published on Wealthy Affiliate — a platform for building real online businesses with modern training and AI.
Hi all,
Today I learned how to Remove Author from Recent Comments Widget and would like to share it:
If your WordPress blog displays a Recent Comments widget on the sidebar or on any widget area, you may want to hide your own ( Post Author ) comments or replies from the list. There’s no need to edit core WordPress files. You can use the widget_comments_args filter.
- Go to your Dashboard
->Appearance <code>-> Editor - Select your functions.php ( it is recommended that you do this on a child theme )
Ready to put this into action?
Start your free journey today — no credit card required.
- Add the code below (in Bold) above the // END ENQUEUE PARENT ACTION then click save.
- function ra_recent_comments_less_author( $array ) { global $post; $array['user_id'] = !$post->post_author; return $array; } add_action( 'widget_comments_args', 'ra_recent_comments_less_author' );
- Your screen should look like this:

Source: http://ronangelo.com/remove-author-from-recent-com...
I followed the steps and it worked!
I don't see may name under the Recent comments widget anymore. Yay!
Regards,
Dira
Share this insight
This conversation is happening inside the community.
Join free to continue it.The Internet Changed. Now It Is Time to Build Differently.
If this article resonated, the next step is learning how to apply it. Inside Wealthy Affiliate, we break this down into practical steps you can use to build a real online business.
No credit card. Instant access.
