WordPress 4.5 Improves Comment Moderation Screens

commentsBuilding on the momentum generated from the WordPress 4.4 development cycle, WordPress 4.5 includes a number of enhancements to comments. In a post on the Make Core blog, Rachel Baker explains the changes and what to expect.

“WordPress 4.5 includes several ancient bug fixes and a few enhancements in the Comments component. We have closed 25 tickets,” Baker said.

The biggest change users will notice are the design improvements to the comment moderation screen when clicking one of the available links in a comment moderation email. Instead of appearing as a large block of plain-text, comments are formatted as long as they contain the following HTML elements.

  • A – Links
  • Abbr – Abbreviations
  • Acronym – Defines an acronym
  • B – Bold
  • Blockquote – Specifies a section that is quoted from another source
  • Cite – Defines the title of a work
  • Code – Defines a piece of computer code
  • Del – Defines text that has been deleted from a document
  • Em – Emphasizes text
  • I – Italicize
  • Q – Defines a short quotation
  • S – Specifies text that is no longer correct
  • Strike – Defines strikethrough text
  • Strong – Defines important text

During testing, I noticed that in some cases, the text still appears in a large block as if the paragraph tag is ignored. I’ve already reported this issue to Baker who is looking into it. As you can see, the text that is bold, blockquoted, linked, and italicized, maintains its formatting on the moderation screen.

Formatted Text On The Comment Moderation Screen
Formatted Text On The Comment Moderation Screen

In addition to visual enhancements, an Edit Comment link was added to the bottom of the comment. In the future, it would be nice to edit a comment in place during the moderation flow, similar to how Quick Edit works, instead of navigating to a different screen. Other notable changes include:

  • Updated message styles that match other screens.
  • The comment date is only wrapped in a link if the comment permalink exists.
  • #wpbody-content is appended to comment moderation email links for accessibility.
  • The rel=nofollow attribute and value pair will no longer be added to relative or same domain links within comment_content.
  • WP_Comment_Query now supports the author_url parameter.
  • The new pre_wp_update_comment_count_now filter allows you to bail out of updating the comment count for a given Post.

Maximum Comment Field Length

Those who publish lengthy comments will be happy to know that in WordPress 4.5, “the comment fields will enforce the maximum length of each field’s respective database column with hardcoded attributes. The hardcoded limits can be adjusted to accommodate custom database schemas using the comment_form_default_fields filter,” Baker said. By default, the limits are as follows:

  • Comment: 65525 characters
  • Name : 245 characters
  • Email: 100 characters
  • Url: 200 characters

When comments are submitted in 4.5, they’ll be checked by the new wp_get_comment_fields_max_lengths() function and the wp_get_comment_fields_max_lengths filter. If a value is more than the limit, a WP_Error is displayed. If a user publishes a comment and sees an error page, they’ll be able to navigate back to their comment via a link rather than having to use their browser’s back button.

Comment Error Page Navigation
Comment Error Page Navigation

It’s great that comments continue to receive attention, even if there’s a long way to go. Unfortunately, the ability to send a notification email when a comment is approved from moderation was punted to a future release. I’m looking forward to reviewing plugins that allow users to easily configure the comment length limits as seen above. It would be nice to configure the limits so spammers see an error message because of their comment’s length rather than being placed into the moderation queue.

To see and test these improvements yourself, download and install WordPress beta 3 on a test site. If you think you’ve discovered a bug, please create a new post on the Alpha/Beta area of the support forums. What do you think of these changes to comments in WordPress 4.5?


11 responses to “WordPress 4.5 Improves Comment Moderation Screens”

  1. Another interesting thing is that Discussion Settings is the part of WP with the most options available. Not sure if any decision was taken there :)

    So probably many settings like pingbacks, trackbacks, settings for avatars could be completely removed and kept all these functionalities just for plugins.
    Just make a comment section simple and clean but easily extensible with plugins.
    Not logical to me to have more options for comments than for anything else.
    WPTavern is a good example, even with so many options on Discussion settings, the site uses plugin for comments.

  2. Hi Jeff,

    Just wanted to let you know that my plugin, WPBruiser (GoodBye Captcha), already has the “Maximum Comment Field Length” functionality implemented allowing users to easily configure the comment form fields length.

    Because my plugin requires at least WordPress 3.5 or or higher, in order to keep compatibility, based on wp_get_comment_fields_max_lengths function’s code, I’ve implemented the same functionality in WPBruiser. By doing this, users do not have to wait until WP 4.5 will be officially released or, in order to use this functionality they won’t be forced to update.

    If the plugin detects WordPress 4.5 or higher, the WordPress’ wp_get_comment_fields_max_lengths filter will be used, otherwise WPBruiser will use its own implementation.

    Also, I’ve implemented the “Maximum Comment Field Length” taking care of the integration with Epoch so… I’ve got it to work with Epoch as well.

    A week ago, I’ve sent you more details about this implementation by email but… no reply since.

    I’m looking forward to reviewing plugins that allow users to easily configure the comment length limits

    I’ll really appreciate having my plugin reviewed here on WPTavern

    ~ Mihai


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: