VIG Digital
arrow_back All articles
WORDPRESS November 1, 2023 · 5 min read

How to Speed Up Your WordPress Website with WP Rocket

Your new website is finished, but it loads slowly and feels sluggish. That hurts the user experience and, in particular, your score on Google PageSpeed. In this article, we will show you a simple way to speed up your website with the WP Rocket plugin.

WP Rocket and its standout features

What is WP Rocket?

WP Rocket is one of the best caching plugins for WordPress today. It has many powerful features and is very easy to set up. Before looking at how WP Rocket works, let’s clarify what a cache is, so it is clear how it speeds up your site.

There are two types of web caching:

Browser-side caching: When you visit a website, the web cache collects the page’s data and stores it as HTML. Your second visit is faster because you already downloaded the content the first time.

Server-side caching: When you visit a website, your browser sends a request to the server. A caching plugin prepares a ready-made HTML file that the browser can load without the server having to build the page for every request, which makes the site load faster.

WP Rocket’s standout features

WP Rocket features:

  • Caches every page and post on your website
  • Enables browser caching
  • Reduces bandwidth with Gzip compression
  • Optimizes font loading
  • Works with your plugins, theme and hosting

You can also configure extra features such as:

  • Cache Preloading – keeps your cache built and ready at all times
  • Minify / Combine – shrinks and combines your CSS / JS files
  • Remove query strings from static resources
  • Lazyload – delays loading images and videos until the visitor scrolls to them
  • Delay JS loading
  • Disable emojis / embeds
  • Combine Google Fonts files

Speeding up your website and configuring the plugin

Installing the plugin

WP Rocket is a paid plugin and is not available in the WordPress plugin directory, so you need to download the installation file from the vendor’s website.

Once downloaded, go to Dashboard -> Plugins -> Add New, choose Upload Plugin, then upload the .zip file you downloaded from the WP Rocket website.

Note: After activating WP Rocket, deactivate and delete any caching, minification, lazyload or similar plugins you installed earlier.

Configuring the plugin

Dashboard

  • Clear Cache: deletes all cache files
  • Preload Cache: rebuilds the cache files
  • Regenerate Critical CSS: generates the critical CSS again

Cache

  • Enable caching for mobile devices: turns on caching for mobile devices
    • Separate cache files for mobile devices: keeps separate cache files for mobile and desktop. If your theme is responsive, leave this unchecked
  • Enable caching for logged-in WordPress users: turns on caching for logged-in users
  • Specify time after which the global cache is cleared: sets how often the whole site cache is cleared automatically

File Optimization

  • Minify HTML: compresses HTML
  • Combine Google Fonts files: merges Google Fonts files
  • Remove query strings from static resources: removes query strings from JS and CSS files
  • Minify CSS files: compresses CSS files
  • Combine CSS files: merges CSS files into one. Minify CSS files must be enabled first. Do not enable this if your website supports HTTP/2
  • Excluded CSS Files: lists CSS files you do not want minified or combined
  • Optimize CSS delivery: optimizes how CSS files are delivered, which helps fix the render-blocking CSS warning in Google PageSpeed Insights
  • Remove jQuery Migrate: removes one JS file and may improve load time
  • Minify JavaScript files: compresses JS files
  • Combine JavaScript files: merges JS files into one
  • Excluded JavaScript Files: lists JS files you do not want minified or combined
  • Load JavaScript deferred: optimizes how JS files load
    • Safe Mode (recommended): check this so jQuery files load first, which reduces the risk of a broken layout

Media

  • Enable for images: turns on lazyload for images
  • Enable for iframes and videos: turns on lazyload for iframes and videos
  • Disable Emoji: disables WordPress emojis
  • Disable WordPress embeds: disables the embed script
  • Enable WebP caching: turns on caching for WebP images

Preload

  • Active Preloading: turns on preloading
  • Activate sitemap-based cache preloading: preloads the cache based on your XML sitemaps
  • URLs to prefetch: DNS prefetching can make files hosted on other domains load faster

Advanced Rules

  • Never Cache URL(s): enter URLs you do not want cached
  • Never Cache Cookies: enter the IDs of cookies you do not want cached
  • Never Cache User Agent(s): enter user agent strings you do not want cached
  • Always Purge URL(s): enter URLs whose cache should be cleared whenever you publish or update a post
  • Cache Query String(s): enter query strings you want cached

Database

Before using this feature, back up your data to avoid unexpected problems.

  • Revisions: deletes post revisions
  • Auto Drafts: deletes auto-saved drafts
  • Trashed Posts: deletes trashed posts
  • Spam Comments: deletes spam comments
  • Trashed Comments: deletes trashed comments
  • Expired transients: deletes expired transients
  • All transients: deletes all transients
  • Optimize Tables: optimizes the database tables
  • Schedule Automatic Cleanup: schedules a database cleanup daily, weekly or monthly

CDN

  • Enable Content Delivery Network: turn this on if your website uses a CDN. If you use Cloudflare, you do not need to enable it
  • CDN CNAME(s): enter your CDN URL here
  • Exclude files from CDN: enter the URLs of files you do not want served from the CDN

Heartbeat

This feature can change how your website behaves, so think carefully before using it.

  • Control Heartbeat: reduces or disables API activity, which can help limit resource usage on your server
    • Behavior in backend: the admin area
    • Behavior in post editor: the post editor
    • Behavior in frontend: the public-facing site
      • Reduce activity: reduce activity (recommended)
      • Do not limit: no limit
      • Disable: disable

Tools

  • Export settings: downloads your WP Rocket settings file to your computer
  • Import settings: uploads a WP Rocket settings file from your computer
  • Rollback: lets you downgrade WP Rocket to an older version

Finally, click Save Changes to save all your settings.