How to disable live commenting in Epoch

Background

By default, when you are viewing a post, and another visitor posts a comment, it will be automatically added to the page. To accomplish this, Epoch makes an AJAX request to the server at a regular interval (15 seconds by default) to check if there are new comments.

This check is automatically disabled whenever the browser window is minimized, the browser is not the active application, or another tab is opened. The checking resumes when the page becomes active again.

As a result, especially on high traffic sites, Epoch can cause a large number of requests to be made to the server.

Disabling Live Commenting

This behavior can be turned off with the filter "epoch_live_mode". When this filter is used to disable live commenting, Epoch will still load comments via AJAX (an essential step to allow for Epoch to be used with caching plugins.)

Once the comments are loaded no further requests will be made, for that page load.

To disable live mode, simply add this line of code to your theme's functions.php, or a plugin.

add_filter(  'epoch_live_mode', '__return_false' );
	

Still need help? Contact Us Contact Us