Article written by

Ronnie T. Dodger's name stems from the old BBS days before Al Gore invented the Internet. Ronnie is a big fan of Al and thinks he is the bomb.In Ronnie's spare time, he loves to tinker with WordPress, Php, jQuery, and anything inter-webs. Ronnie is available for hire, but you will have to ask him about that!

28 responses to “How to remove inline Recent Comments style from WordPress”

  1. Evan Watkins

    Nice article, sometimes I get confused on how to remove part of my wordpress theme, thanks for the tutorial!

  2. Laurie PK

    Hi Ronnie,

    Your instructions seem clear — but it didn’t work at all for me! I’d rather delete the Comments widget and delete the line of code. But, I can’t find it in the theme code anywhere!

    Any ideas how I can just delete it?


  3. James

    I got that working on my blog, thanks for a great tip.

  4. Narcis

    Thanks for your post, i really needed this tutorial

  5. Alejandro Arco

    Nice post, i needed this tutorial :)

  6. neel

    Nice and simple tutorial to style the comments

  7. Artem Russakovskii

    Very useful. I did just notice this style and couldn’t figure out where it’s coming from. This is a really bad design practice, IMO. WP should have just added a widget setting with the style in it rather than hardcoding it like that.

  8. Artem Russakovskii

    BTW, your solution didn’t work for me either.

    After debugging the core code, I found that I need to replace the filter name with “WP_Widget_Recent_Commentsrecent_comments_style25″ in both remove_filter() and has_filter() calls.

    This is most likely because I’m using WP 2.8 which came out after your initial post.

    The nasty file adding the CSS is in wp-includes/ and is called default-widgets.php.

  9. oes tsetnoc

    Thanks for the tutorial.. i was looking for that for my wordpress

  10. Kevin

    Thanks for the info. that helps me.

  11. Artem Russakovskii

    FYI, I hope to get it fixed in WP core using this ticket: as my own solution above doesn’t really work – the filter name changes.

  12. How To Remove Inline Hardcoded Recent Comments Sidebar Widget Style From Your WordPress Theme

    [...] hook, which would prevent it from ever firing and injecting the CSS. In fact, somebody over at already took a crack at this approach with the following code, which may have worked for a while [...]

  13. Artem Russakovskii
  14. daddy design

    nice article. thanks!

  15. Jan James

    The remove_filter reference page ( states that “Plugin authors should prevent the usage of this function if possible.”

    How serious is this? I see remove_filter used all of the place in themes and plugins.

  16. John

    Thanks, this did bug me! Nice to be able to take it out.


  17. John

    Hey it didn’t work initially but if you use function #10 on this article:
    You can see that they added a random string to the function, I just adjusted your code with the new filter name and it worked fine. Not sure if it changes for each WP install but for me the filter name was:


  18. Mike

    This doesn’t seem to work in WP 3.0 with Twenty Ten. Has anyone found an alternative method to get rid of this?

  19. Stever

    The fix for 3.0 is simply to rename wp_widget_recent_comments_style to recent_comments_style in Ronnie’s custom filter above.