Opened 5 years ago
Last modified 4 years ago
#54851 new defect (bug)
Prevent unnecessary code comments from being output to the front end
| Reported by: | kjellr | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
Gutenberg's "Post Comments" block appears to pull its code from the WordPress' theme compat comments.php file here:
This includes some code comments that may be useful for developers, but don't actually need to be send to the front end:
I'd suggest we change these from HTML comments to PHP comments, so they aren't visible in the outputted markup.
---
Related: https://github.com/WordPress/gutenberg/issues/37989
Tested with Gutenberg 12.4
WordPress 5.8.3
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)

That effectively kills the line after it which is where "Comments are closed" is output, but without just deleting it completely.
if ( 0 && ! comments_open() ) :
simplest way is to find out the following line and delete or comment it.