| 开发者 |
joelcj91
duckdev foxelabs |
|---|---|
| 更新时间 | 2026年8月22日 15:14 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
comments_template()) and block themes (the core Comments block) out of the box.
FeaturesUseful links
- Lazy-load comments on scroll, on button click, or turn the plugin off without deactivating it.
- Works with classic themes and block themes (the core Comments block).
- Loads comments inline for search engine crawlers, so indexing and SEO are not affected.
- Per-post cache of the rendered Comments block — REST renders stay fast.
- Minimum-comment-count threshold so short threads still render inline.
- Customisable load-button text, style and extra CSS classes.
- Clean React settings page under Comments → Lazy Load.
- No jQuery dependency. Front-end script is vanilla JS and intentionally small.
- Translation-ready. Hooks and filters available for further customisation.
lazy-load-for-comments folder to /wp-content/plugins/.Yes. The plugin detects whether the active theme is a block theme and either swaps the classic comments_template() output or replaces the rendered core/comments block, whichever applies.
Yes. The placeholder rendered server-side is plain HTML, so full-page caches can cache it safely. The actual comments are fetched from a public REST endpoint, which is also cache-friendly.
Open Comments → Lazy Load and pick one of On scroll, On button click or Disabled on the Settings tab.
The button text, the style (inherit your theme's style or use the plugin's built-in style) and extra CSS classes can all be set under Load Button on the Settings tab.
No — this plugin only handles the default WordPress comments. Third-party comment systems (Disqus, Jetpack Comments, etc.) replace the comment area entirely, so there is nothing for this plugin to lazy-load.
Use the lazy_load_for_comments_can_lazy_load filter:
add_filter( 'lazy_load_for_comments_can_lazy_load', function ( $can ) { if ( is_page( 'contact' ) ) { return false; } return $can; } );
Yes. By default the plugin detects search-engine crawlers from the User-Agent and serves them the original (inline) comments markup, so indexing is not affected. You can turn this behaviour off on the Settings tab if you'd rather always lazy-load.
The official documentation covers most setups. For everything else, the free WordPress.org support forum is the best place to start.
comments_template() populating comments_by_type.