FastComments.com

Add Live Commenting to WordPress Sites on WP Engine

This guide covers installing the FastComments WordPress plugin on a site hosted on WP Engine, and the parts of the WP Engine platform that affect the plugin: the page cache and Edge Full Page Cache, how WP-Cron runs, and the domains used by production, staging, and development environments.

WP Engine runs standard WordPress, so comments on a WP Engine site are handled by the WordPress comment system or by an installed comment plugin. The FastComments plugin replaces the theme's comment section with the FastComments widget. Plugin setup, comment import, moderation, notifications, and SSO work the same way as on any WordPress site and are documented in the WordPress guide.

This tutorial requires a FastComments account. You can create an account here.

Install the Plugin Internal Link

In the WordPress admin, go to Plugins > Add Plugin, search for FastComments, click Install Now, and then Activate. The plugin can also be downloaded from wordpress.org and uploaded with Plugins > Add Plugin > Upload Plugin.

After activation, click FastComments in the admin menu. The setup asks whether your account is in the EU, connects the site to a FastComments account, and can upload the site's existing WordPress comments. Keep the setup page open until the upload finishes. Each setup step, as well as moderation, notifications, and SSO, is described in the WordPress guide.

WP Engine Plugin Policies

FastComments is not on WP Engine's list of disallowed plugins. WP Engine states that this list is the only source of truth for disallowed plugins.

Network Requirements

All communication between the plugin and FastComments is outbound HTTPS from the WordPress server to fastcomments.com, or eu.fastcomments.com for EU accounts. Comments are synced back to WordPress by the WordPress server polling FastComments, so FastComments does not open inbound connections to the site.

The plugin's setup page calls admin-only REST API routes on the site under /wp-json/fastcomments/v1/api/, requested as /index.php?rest_route=/fastcomments/v1/api/.... These routes only accept requests from logged-in administrators.

Page Cache Internal Link

WP Engine caches pages for 600 seconds (10 minutes) by default (Manage Server and Browser Caching). The FastComments widget is rendered in the visitor's browser: the cached HTML contains a <div id="fastcomments-widget"> element and a script that loads from cdn.fastcomments.com (cdn-eu.fastcomments.com for EU accounts). For visitors who are not logged in to WordPress, the widget configuration in the page identifies only the post, so the same cached page can be served to all of them. New comments appear without clearing the cache.

Clearing the Cache After Activation

Pages cached before the plugin was activated still contain the theme's previous comment section until their cache entry expires. To update them immediately, clear the cache once after the FastComments setup finishes, using either method from Manage Server and Browser Caching:

  • WordPress admin: click the WP Engine tab in the main menu, select Caching, and click Clear All Caches.
  • User Portal: on the Sites page, click the environment name, select Cache in the left menu (under Manage), and choose Clear all caches.

Clear All Caches also purges Edge Full Page Cache when it is enabled.

Logged-In Users and SSO

When the plugin's SSO option is enabled, each page includes an SSO payload for the WordPress user who is logged in. WP Engine's default cache exclusions include any request with a cookie whose name contains wordpress_ and has a value set, which covers the wordpress_logged_in_ cookie, and WP Engine states that logged-in user sessions bypass the page cache. A page that contains one user's SSO payload is therefore not served to another visitor.

The same exclusion applies to the plugin's REST API requests from the setup page, which are sent with the administrator's login cookie.

Edge Full Page Cache and the CDN

Edge Full Page Cache (EFPC) caches page HTML on WP Engine's network for domains on Global Edge Security or the Advanced Network. WP Engine's documentation states that EFPC does not respect custom cookie exclusions, and that pages generating personalized content in PHP, such as pages from membership and LMS plugins, may not work correctly with it. If EFPC is enabled for the domain and FastComments SSO is turned on, check that logged-in pages are not shared: log in to WordPress and open a post, then open the same post in a private browser window. The widget in the private window must not show you as logged in.

The WP Engine CDN serves the site's static assets. The FastComments script and the widget's API requests go to FastComments servers, not to the site's domain, so the WP Engine CDN does not cache them.

WP-Cron and Comment Sync Internal Link

The plugin copies new comments, edits, and deletions from FastComments into the WordPress database with a WP-Cron event, fastcomments_cron_hook. The interval is set with Sync Interval under Advanced Settings on the FastComments plugin page: every 24 hours (the default), every hour, every 15 minutes, or every 5 minutes. A large initial comment import also continues in the background through one-off WP-Cron events.

Default WP-Cron Behavior

By default, WP-Cron checks for due events when a page loads, so events run only when the site receives traffic. WP Engine documents low traffic as the most common reason an event misses its scheduled time (Event Scheduling and wp-cron). Page views served from the page cache are not processed by PHP and do not trigger WP-Cron, so on a site where most anonymous traffic is cached, the FastComments sync can run later than the selected interval.

Enabling Alternate Cron

WP Engine's Alternate Cron is a service on the server that requests wp-cron.php every minute and runs events that are due. Enable it for each environment where the plugin is active:

  1. In the WP Engine User Portal, go to the Sites page and select the environment.
  2. Click Utilities in the left menu. You may need to expand the Advanced dropdown.
  3. Turn on the Alternate cron toggle.

Alternate Cron sets define( 'DISABLE_WP_CRON', true ); in the environment's wp-config.php. Adding that line manually does not enable Alternate Cron.

Alternate Cron works with WP Engine's password protection. It does not work on environments protected with other methods, such as basic authentication, because wp-cron.php must remain publicly accessible. WP-Cron also does not work on sites behind basic authentication.

Checking the Sync Event

Over SSH, list the sync event and its next run time with WP-CLI, or run it immediately:

Check the FastComments Sync Event
Copy Copy
1
2wp cron event list --hook=fastcomments_cron_hook
3wp cron event run fastcomments_cron_hook
4

A sync can also be started from the FastComments plugin page with Manually Sync.

Customization Internal Link

Styling and configuration options for the widget are described in the Customization Documentation.

Customization rules created in your FastComments account are loaded by the widget in the browser, so they apply to pages already in the WP Engine page cache without clearing it.

Plugin settings, such as the widget type and the sync interval, are under Advanced Settings on the FastComments plugin page in the WordPress admin.