W
WordPress SOPKnowledge Base
Search
← All topics

WP Rocket Configuration

runnable

WP Rocket recommended settings for Elementor sites: cache tab, file optimization (no combine CSS/JS), media lazy loading, preload, advanced rules for WooCommerce exclusions, Cloudflare add-on setup, and WP-CLI cache clear commands.

wp-rocketcachingperformanceminificationelementor
Agent trigger phrases: wp rocket setup · wp rocket settings · wp rocket elementor · wp rocket cloudflare · wp rocket woocommerce · wordpress caching plugin · minify css wordpress · delay javascript wordpress

WP Rocket is the preferred caching and performance plugin. Correct settings matter — wrong configuration breaks sites.

Cache Tab

| Setting | Value | Notes | |---------|-------|-------| | Enable caching for mobile | ON | — | | Separate cache for mobile | OFF | Unless using different mobile theme | | User cache | OFF | Enable only for membership sites | | Cache lifespan | 10 hours | Increase for static sites |

File Optimization Tab

| Setting | Value | Warning | |---------|-------|---------| | Minify CSS | ON | Safe | | Combine CSS | OFF | Breaks Elementor | | Minify JS | ON | Safe | | Combine JS | OFF | Breaks plugins | | Load JS deferred | ON | Test thoroughly | | Delay JS execution | ON | Test — can break sliders | | Remove unused CSS | ON | Safe for most Elementor sites |

Media Tab

| Setting | Value | |---------|-------| | Lazy load images | ON | | LazyLoad iframes/videos | ON | | Replace YouTube thumbnails | ON | | WebP compatibility | ON |

Preload Tab

| Setting | Value | |---------|-------| | Activate preloading | ON | | Preload links | ON | | Prefetch DNS requests | Add: Google Fonts, GTM, analytics domains |

Advanced Rules

Never cache these URLs:

/wp-admin/
/checkout/
/cart/
/my-account/
/wp-login.php

WP Rocket + Cloudflare Add-on

  1. WP Rocket > Add-ons > Cloudflare
  2. Enter: Email address, Global API Key, Zone ID
  3. Enable: "Optimal Settings" and "Auto-purge Cloudflare cache on update"

WP-CLI Cache Operations

# Clear all WP Rocket cache
wp cache flush

# WP Rocket specific clear (if plugin CLI available)
wp rocket clean --confirm

# Preload cache after clearing
wp rocket preload --confirm

Lighthouse Score Targets

After WP Rocket + Cloudflare + ShortPixel:

  • Performance: 90+
  • LCP: < 2.5s mobile
  • CLS: < 0.1
  • TTFB: < 200ms on WPX, < 300ms on shared hosting