Expandable Dashboard Recent Comments


By default, the ‘Comments’ section of the ‘Activity’ admin dashboard widget only shows an excerpt for the comments, truncating the content of the comments to the first 20 words while at the same time stripping out all markup.

This plugin adds a link at the end of the comment actions row (the links for the comment that become visible under the comment when you hover over the comment). The “Show more” link, when clicked, will replace the excerpt with the full comment. The full comment will include all markup, including originally utilized markup and changes applied via filters, plugins, etc (such as shortcode expansion, smilies, paragraphing, etc). The full comment can be switched back to the except by clicking the “Show less” link (which replaces the “Show more” link when the comment is expanded).

“In-place expansion” refers to the ability to click the link to see the full comment and it will be presented in place of the excerpt without requiring a page reload or navigation.

NOTE: This plugin only works for users who have JavaScript enabled.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage


The plugin exposes one filter for hooking. Such code should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).

c2c_expandable_dashboard_recent_comments_start_expanded (filter)

The ‘c2c_expandable_dashboard_recent_comments_start_expanded’ hook allows you to configure the ‘Recent Comments’ admin dashboard widget initially display all comments in their expanded state (i.e. not excerpted).


  • $default (boolean): The default state, which is ‘false’ (therefore comments are initially shown excerpted)
  • $comment (object) : The comment object being displayed


// Initially show dashboard comments fully expanded
add_filter( 'c2c_expandable_dashboard_recent_comments_start_expanded', '__return_true' );


  • A screenshot of the 'Recent Comments' admin dashboard widget with the plugin active, showing comments that have been truncated/excerpted by WordPress (the 2nd and 4th listed) and full, short comments. The third comment has the mouse over it (though the cursor doesn't appear in the screenshot) so you can see the action links, including the "Show more" link. Note, also, the 'Expand All' and 'Collapse All' links added to the bottom of the widget.
  • A screenshot of the 'Recent Comments' admin dashboard page with the plugin active, now showing the second excerpted comment (the third comment in the list) fully in-place expanded and with markup and formatting applied.


  1. Install via the built-in WordPress plugin installer. Or download and unzip expandable-dashboard-recent-comments.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
  3. Visit the admin dashboard and check out the ‘Comments’ section of the ‘Activity’ widget (assuming you have recent comments and that one or more of them have been automatically excerpted)


How do I expand an excepted comment?

When you hover over the comment, a line of action links will appear (typically “Approve”, “Reply”, “Edit”, “Spam”, and “Trash”). If the comment has been automatically excerpted by WordPress, then a “Show more” link will appear. Click it to view the full comment.

Why don’t I see the “Show more” link when hovering over a comment?

The comment has not been been excerpted; you are already seeing the comment in its entirety so there is no need to be able to “show more”.

Why don’t I see the “Expand all” and “Collapse all” links at the bottom of the widget?

Assuming you are using a supported version of WordPress, this just means that none of the comments being listed have been excerpted, thus there is no need to be able to “Expand all” or “Collapse all” in this instance.

Why does either of the “Expand all” or “Collapse all” links appear grayed out?

If all of the comments in the widget are currently collapsed, then the “Collapse all” link will appear grayed out to indicate there is nothing for it to collapse. Likewise, if all of the comments in the widget are currently expanded, then “Expand all” will appear grayed out to indicate there is nothing for it to expand. As comments are expanded and collapsed, these two links will adjust themselves to appear grayed out or active as appropriate.

Can I make it so all comments initially appear fully expanded without needing to click the links to expand them?

Yes. Please see the “Hooks” section for documentation on the ‘c2c_expandable_dashboard_recent_comments_start_expanded’ filter which allows for this.

Does this plugin include unit tests?



Read all 2 reviews

Contributors & Developers

“Expandable Dashboard Recent Comments” is open source software. The following people have contributed to this plugin.



2.5.2 (2019-03-03)

  • Fix: Ensure preceding up/down arrow for collapse/expand link does not get orphaned from the associated text
  • New: Add inline documentation for hooks
  • Change: Initialize plugin on ‘plugins_loaded’ action instead of on load
  • Change: Cast return value of filter ‘c2c_expandable_dashboard_recent_comments_start_expanded’ as boolean
  • Change: Rename readme.txt section from ‘Filters’ to ‘Hooks’
  • Change: Note compatibility through WP 5.1+
  • Change: Update copyright date (2019)
  • Change: Update License URI to be HTTPS

2.5.1 (2018-04-30)

  • New: Add README.md
  • Change: Add GitHub link to readme
  • Change: Unit tests: Minor whitespace tweaks to bootstrap
  • Change: Note compatibility through WP 4.9+
  • Change: Update copyright date (2018)

2.5 (2017-02-02)

  • Change: Gray out global expand and/or collapse link if the action doesn’t have a comment to expand/collapse, respecively.
  • Change: Remove box-shadow highlight from links, which were visible after being clicked.
  • Change: Vertically center expand/collapse dashicons.
  • Change: Escape translated strings used in attributes.
  • Change: Use class rather than inline styles to indicate which controls should be initially hidden.
  • Change: Use sprintf() to format output markup rather than concatenating strings, variables, and function calls.
  • Change: No need to explicitly enqueue jQuery.
  • Change: Default WP_TESTS_DIR to /tmp/wordpress-tests-lib rather than erroring out if not defined via environment variable.
  • Change: Enable more error output for unit tests.
  • Change: Note compatibility through WP 4.7+.
  • Change: Remove support for WordPress older than 4.6 (should still work for earlier versions back to WP 3.8)
  • Change: Minor inline code documentation reformatting.
  • Change: Minor readme.txt improvements.
  • New: Add LICENSE file.
  • Change: Add inline docs for class variables.
  • Change: Update copyright date (2017).
  • Change: Update screenshots.

2.4.2 (2016-01-09)

  • Change: Add support for language packs:
    • Change textdomain to ‘expandable-dashboard-recent-comments’ from ‘c2c_edrc’.
    • Don’t load textdomain from file.
    • Remove .pot file and /lang subdirectory.
  • Change: Note compatibility through WP 4.4+.
  • Change: Explicitly declare methods in unit tests as public.
  • Change: Update copyright date (2016).
  • Add: Create empty index.php to prevent files from being listed if web server has enabled directory listings.

2.4.1 (2015-08-18)

  • Update: Note compatibility through WP 4.3+

2.4 (2015-03-06)

  • Use Dashicons icons for all expand/collapse links (removing special character usage from string)
  • Remove get_ellipsis() since it was only needed for WP < 3.6
  • Remove JS support for WP < 3.8
  • Remove is_admin() check preventing loading of class
  • Added meager unit tests
  • Reformat plugin header
  • Space out admin.css content
  • Change documentation links to wp.org to be https
  • Minor documentation spacing changes throughout
  • Change description
  • Note compatibility through WP 4.1+
  • Dropped support for versions of WP older than 3.8
  • Update copyright date (2015)
  • Update screenshots
  • Add plugin icon
  • Regenerate .pot

2.3 (2013-12-24)

  • Fix CSS selectors to properly format full comments under WP 3.8
  • Fix JS selectors to show Expand/Collapse All links under WP 3.8
  • Add Frequently Asked Questions section to readme.txt
  • Note compatibility through WP 3.8+
  • Update copyright date (2014)
  • Add banner
  • Minor readme.txt text and formatting tweaks
  • Change donate link


  • Fix support for WP3.6+ due to core’s change of ‘…’ to ‘…’ for the excerpt ellipsis
  • Add is_text_excerpted(), get_ellipsis()
  • Note compatibility through WP 3.6+


  • Add ‘comment’ arg to is_comment_initially_expanded() for context
  • Add ‘comment’ as additional arg to ‘c2c_expandable_dashboard_recent_comments_start_expanded’ filter
  • Change description (to shorten)
  • Add check to prevent execution of code if file is directly accessed
  • Regenerate .pot
  • Re-license as GPLv2 or later (from X11)
  • Add ‘License’ and ‘License URI’ header tags to readme.txt and plugin file
  • Remove ending PHP close tag
  • Minor improvements to inline and readme docs
  • Minor code reformatting (spacing)
  • Note compatibility through WP 3.5+
  • Update copyright date (2013)
  • Move screenshots into repo’s assets directory


  • Use “Show more”/”Show less” links in comment row actions instead of appending expand/collapse link
  • Add filter ‘c2c_expandable_dashboard_recent_comments_start_expanded’ to permit initial display of comments in expanded state
  • Remove class configuration array
  • Remove filter ‘c2c_expandable_dashboard_recent_comments_config’
  • Enqueue CSS
  • Enqueue JS
  • Add register_styles(), enqueue_admin_css(), enqueue_admin_js()
  • Remove add_css(), add_js()
  • Add support for localization
  • Add .pot
  • No longer hide the ellipsis
  • Hook ‘load-index.php’ action to initialize plugin rather than checking pagenow
  • Add version() to return plugin version
  • Minor code reformatting (spacing)
  • Note compatibility through WP 3.3+
  • Drop support for versions of WP older than 3.1
  • Update screenshots (now based on WP 3.3)
  • Add link to plugin directory page to readme.txt
  • Update copyright date (2012)


  • Note compatibility through WP 3.2+
  • Minor code formatting changes (spacing)
  • Fix plugin homepage and author links in description in readme.txt


  • Don’t display expand/collapse links for users without JavaScript and jQuery enabled
  • Add admin unobtrusive javascript to handle expand/collapse of comments when links are clicked
  • Use substr() instead of preg_match() to detect presence of ‘…’
  • Remove ‘onclick’ attribute for links (perform via unobtrusive JS)
  • Fix plugin links in description in readme.txt


  • Add link to plugin homepage to description in readme.txt


  • Switch from object instantiation to direct class function invocation
  • Explicitly declare all functions public static and class variables public static
  • Note compatibility with WP 3.1+
  • Update copyright date (2011)


  • Add filter ‘c2c_expandable_dashboard_recent_comments_config’ to allow filtering of config options
  • Rename class from ‘ExpandableDashboardRecentComments’ to ‘c2c_ExpandableDashboardRecentComments’
  • Store plugin instance in global variable, $c2c_expandable_dashboard_recent_comments, to allow for external manipulation
  • Move is_admin() check to before class creation
  • Add init() and move hooking of actions/filters to there
  • Remove docs from top of plugin file (all that and more are in readme.txt)
  • Note compatibility with WP 3.0+
  • Minor code reformatting (spacing)
  • Add Filters and Upgrade Notice sections to readme
  • Remove trailing whitespace in header docs


  • Add full PHPDoc documentation
  • Minor formatting tweaks
  • Note compatibility with WP 2.9+
  • Update copyright date
  • Update readme.txt (including adding Changelog)


  • Initial release