Comments showing twice at top of page


Trying to get Discourse set up on my site to take over the role of WP comments and more. Got everything installed (correctly, so I thought), the plugin is connected, publishing seems to work fine, but comments are displaying completely broken on my test page.

The comment thread is displaying as the very first thing in my body html tag - twice. Something is broken, but I’m not sure how to find it. Have tried disabling all my plugins and custom PHP in case something was conflicting. My theme dev runs Discourse and doesn’t think it’s coming from the theme code:

“The output on your page suggests output has been echoed into a filter, when it should really only be returned to the filter.”

Here’s my test. WP comments only display for logged in users, but Discourse looks the same logged in or out: Test Subject. Page doesn’t throw any html errors with Discourse comments turned off.

Any ideas would be much appreciated. I’m pretty comfortable with troubleshooting, but not sure where to look to find a code error like this. Scanned the Discourse server error logs, but I didn’t notice anything weird/know what to look for. Running PHP 8.1, fwiw…

Please advise what details I can provide.



EDIT: forgot to mention that ticking the “Ajax” box in Discourse comment settings stops the double output, but it’s still at the top of the html.

Hey there @soitwouldseem. I suspect the issue is in your theme. Could you try a standard Wordpress theme (i.e. one that comes packaged with Wordpress) on your dev site? If comments work correctly on a standard theme, that will tell us whether it’s the theme.

Thank you. I’m embarrassed to have missed that; switching themes seems to fix the problem. I’ll reach out to my dev.

1 Like