Tag: comments

  • Inform user about automatic comment closing time

    To prevent spammers from flooding old articles with useless comments you can set WordPress to close comments after a certain number of days: It might be surprising for some users if the comments are closed automatically so it might be a good idea to inform them about the remaining time. add_action( ‘comment_form_top’, ‘topic_closes_in’ ); function…

  • Comment Length Limiter

    Comment Length Limiter

    If you have used Twitter, then you know that you are only allowed to type 140 characters in a single Tweet. There is a nice little number below the text field indicating how much is left to write.

  • Advent Calendar- How to disable comments for WordPress pages in any theme

    Advent Calendar- How to disable comments for WordPress pages in any theme

    Usually you don’t need comments on pages. Unfortunately, WordPress doesn’t offer a separate option to leave comments on posts on and turn them off for pages. If your theme calls comments_template(); in its page.php and you don’t want to break automatic updates, you cannot just remove the function call, because it will be overwritten with…

  • Plugin to Remove Comments Completely from WordPress

    Plugin to Remove Comments Completely from WordPress

    The comment feature in WordPress is an essential component of blogs – but not in all cases it’s needed, especially if you use it as a traditional CMS. Sure, you can just leave out the comment form while you creating a theme and disable the comment options in your backend. But this is not the…

  • Adding Input Fields To Comment Form

    Adding Input Fields To Comment Form

    Most comment forms contain the same input fields: Name, Email, URL and the comment text field. This is sufficient for most use cases but there are situations where you might want to know a bit more about your commenter: their age, the city they live in, or the color of their underwear. This article explains…

  • Comment Form Hooks Visualized

    Most themes (e.g. TwentyTen) use the comment_form() function to insert the comment form after posts. There are quite some hooks inside the function but they are hard to localize. The codex documentation isn’t too helpful, neither. To give you an easy overview the following diagrams visualize the points where the various hooks are anchored. The…