Opened 15 months ago
Last modified 6 weeks ago
#63631 new enhancement
MultiSite: Remove links to Manage Comments for sites that don't have Comments (or similar logic)
| Reported by: | MadtownLems | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Networks and Sites | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | multisite |
Description
In MultiSite, the My Sites Admin Bar Menu dropdown has a link for "Manage Comments" for every single site, regardless of whether or not that site has existing comments, has comments open, etc. As allowing comments becomes rarer and rarer across the Internet over time, these are starting to feel like clutter.
Perhaps this link should be removed (optionally added back via plugin if desired), or only present if certain conditions are true - such as the site actually HAS any comments.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the report. A few notes from looking at
wp_admin_bar_my_sites_menu()(wp-includes/admin-bar.php), where the "Manage Comments" node (blog-{id}-c) is built.The main thing to weigh here is performance. Any "site has comments" condition would need a
wp_count_comments()call per blog inside theswitch_to_blog()loop, on every page load, scaling with the number of sites a user belongs to. That is the same concern that led to thewp_admin_bar_show_site_iconsfilter in 6.0.0 (#54447), so a per-site count query would need a strong justification.The semantics are also ambiguous: "has comments" and "has comments open" are different, and a site with comments closed can still hold a moderation backlog, so hiding the link there could remove access to a screen that is still needed.
On the "add back via plugin" idea: there is currently no clean way to remove just this node, short of relying on the internal node ID, which is fragile. That is actually an argument for a plain opt-out filter (e.g.
wp_admin_bar_show_manage_comments, defaulttrue). It would give a supported way to hide the link, avoid any query cost, and keep current behaviour unchanged.Sharing this mainly so the performance trade-off is on the record.