FB Share Issue with WordPress Cache Plugin

When a link looks fine in the browser but Facebook shows an old title, wrong image, or blank preview, I treat it as an fb share issue with wordpress cache plugin problem—especially with W3 Total Cache page caching. Facebook’s crawler uses its own user agent; if it receives a cached HTML page built for someone else (or a stale page), Open Graph data in the share dialog can be wrong.

FB share issue with WordPress cache plugin W3 Total Cache

What causes the FB share issue with WordPress cache plugin setups

W3 Total Cache can store a full HTML page and reuse it for later requests. The Facebook crawler identifies itself with facebookexternalhit (see the UA strings below). If that request is served a normal browser cache entry—or a mobile/desktop variant that does not match what you expect—the scraped og: tags may not match the live post.

This post documents two W3 Total Cache approaches that were already in use here: give Facebook its own cache group, or refuse to cache that user agent at all. Related OG image sizing notes: Facebook image size.

Before and after fb share issue with wordpress cache plugin

Solution A: create a different cache for Facebook

Use W3 Total Cache User Agent Groups so requests from Facebook get a separate page-cache bucket.

  1. Go to W3 Total Cache settings (Performance) > User Agent Groups page.
  2. While you are at it, tick Enabled for the predefined groups there. This solves the Mobile specific settings have no effect problem too.
  3. Click the Create a group button at the top.
  4. Enter Facebook as the group name.
  5. Add this to the User agents field:
facebookexternalhit
facebookexternalhit/1.1
facebookexternalhit/1.0
  1. Click the Save all settings button.

Solution B: reject caching for Facebook

Alternatively, tell page cache not to store responses for those user agents at all (Facebook always hits a fresh generate).

  1. Find the W3 Total Cache settings (Performance) > Page cache > Advanced section > Rejected user agents setting.
  2. Add this as value:
facebookexternalhit
facebookexternalhit/1.1
facebookexternalhit/1.0
  1. Click the Save all settings button.
W3 Total Cache settings for fb share issue with wordpress cache plugin

The Facebook Crawler

For reference, these are the Facebook crawler user-agent strings kept with this note (including the longer form with the externalhit URL):

facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
facebookexternalhit/1.1

Match what you paste into W3 Total Cache against these. After changing cache rules, empty the W3 Total Cache page cache, then re-check the URL in Facebook’s Sharing Debugger so Facebook scrapes again instead of reusing its own cached preview.

Which solution to pick

  • Solution A — Facebook still uses page cache, but in its own user-agent group (also useful if you already rely on UA groups for mobile).
  • Solution B — Facebook bypasses page cache entirely via Rejected user agents.

Both target the same facebookexternalhit agents listed above. Use one approach; you do not need both unless you are testing which behaves better on your host.

FAQ

Is this only for W3 Total Cache?

Yes. The menu paths in this post (User Agent Groups, Page cache → Rejected user agents) are W3 Total Cache settings. Other cache plugins have different UIs; the same idea is “special-case or exclude facebookexternalhit.”

Why enable the predefined User Agent Groups too?

As noted in Solution A step 2: enabling those predefined groups also fixes the “Mobile specific settings have no effect” issue in W3 Total Cache.

Preview still wrong after saving?

Purge W3 Total Cache’s page cache, then use Facebook’s Sharing Debugger to scrape the URL again. Facebook keeps its own preview cache separately from WordPress.

Do I paste all three facebookexternalhit lines?

Yes—use the same three lines shown in Solutions A and B (facebookexternalhit, facebookexternalhit/1.1, facebookexternalhit/1.0). The longer crawler string in the last section is the fuller UA Facebook has used; keep your W3 fields aligned with what you intend to match.

Wrap-up

For an FB share issue with WordPress cache plugin stacks built on W3 Total Cache: either give facebookexternalhit its own User Agent Group cache, or reject that agent in Page cache → Advanced. Save, purge page cache, and re-scrape the URL in Facebook’s debugger if the old preview sticks.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top