WP Discourse Comments Block

From version 2.4.7, the WP Discourse Plugin includes a Discourse Comments block for the Block Editor. The Discourse Comments block is primary way to add Discourse Comments to a block-enabled theme such as Twenty Twenty Three. Here’s a short video on how to use the Discourse Comments block

Next Step

If you haven’t yet, make sure you check out:

Notes

  • The Discourse Comments block does not currently support the “Load Comments With Ajax” setting.
  • To learn more about Block Themes in Wordpress you can read more about them here.
4 Likes

what time support “Load Comments With Ajax” setting?
my wordpress use full page cache, so need ajax loading comments.

I think you should exclude comments from caching. That is common procedure. Caching is only for static content by its nature, and commenting isn’t part of that.

1 Like

My WordPress site has a very high traffic volume, with around 5-8 million visits per day, and approximately 200 million visits per month. These statistics come from Cloudflare.

As a result, I’ve implemented full page caching, which can be considered static pages. Therefore, I want the comments to be dynamically loaded via AJAX. In addition to displaying the comments in real-time, I also want to ensure that comments do not cause any performance degradation in WordPress.

Your wordpress is getting huge amount of bots. You need something on its end. Known, and very little spoken issie, because admins like big numbers.

Yes, there are a large number of robots. Since my WordPress is a news and information website, it naturally attracts a lot of traffic.

Has nothing to do with nature of your site. The most are useless seo-bots, scrapers and knockers. There is only about dozen you want, and easily 99% of total amount only increases the load of your server.

I mean you should first take that load off, and after that start wondering if showing discourse comments are an issue.

1 Like

@shuaiZend Can you confirm the exact issue you’re having? Are the comments not loading? Please share an example link or screenshot if you can.

1 Like

yes, I setting use AJAX.
But comments not loading.

USED AJAX


Disabled AJAX

Only “Load comments with Ajax” Disabled:

other

test: discourse comments test – test

Hey @shuaiZend, thanks for trying to explain. However, I’m still not quite sure what the problem is? The comments are loading when you have “Load comments with Ajax” disabled. Why not just leave that setting disabled?

Because WordPress has a lot of traffic and uses full page cache, I hope to dynamically load comments in the form of ajax without affecting the performance of WordPress.

I still can’t understand why you don’t exlude commenting from caching, as you should (and BTW what is guided by a plugin that does caching for you; if you do caching via a reverse proxy, as Nginx or Varnish, that job is even easier).

And you really should kill the overload, that isn’t coming from people. And tune up your php-fpm settings.

You are now solving in wrong place.

1 Like

@shuaiZend This is indeed the first step I’d also recommend. Are you able to do this?