WeWP
ComparePricingFeaturesContact UsLoginTry For Free
  • Knowledge Base
  • How to Fix "Not Secure" or "Not Private" Connection Errors
  • How to Add Cron Jobs
  • Connect to Your Server via SSH on Windows
  • Keeping Servers and Sites Secure
  • Troubleshooting Cloudflare Issues
  • Install WordPress Themes and Plugins with Composer
  • How To Fix Mixed Content Issue For WordPress
  • What Is a DDoS Attack and How to Prevent It?
  • How to Enable WordPress Debug Mode
  • How to Fix the “MySQL server has gone away” Error
  • How to Configure WP Mail SMTP Plugin to Send Emails
  • How To Fix the “HSTS Missing From HTTPS Server” Error
  • How to Check Your Domain's Expiration Date
  • How to Use and Serve WebP Images in WordPress
  • Email security best practices for using SPF, DKIM, and DMARC
  • What is a LEMP (Linux, Nginx, MySql, PHP) Stack?
  • Deploying Web Applications with NGINX HTTP Server
  • How to Configure WP Rocket Plugin for WordPress
  • How to Check SPF and DKIM Records with WeWP
  • Understanding FTP vs SFTP: Which Should You Use for Secure File Transfers?
  • What is a DMARC record and How to Set it Up?
  • How to Set Up Cloudflare’s Free CDN for WordPress
  • How to check your Ubuntu version (Using the command line and GUI)
  • How to Download Backups from WeWP panel
  • How to Change the PHP Version of Your Hosting Plan
  • Troubleshooting Cloudflare Universal SSL
  • How to Fix “Your Domain Is Not Pointing” Error
  • SSH vs SSL: What’s the Difference?
  • WordPress Search and Replace
  • How to Force HTTPS on WordPress Websites
  • How to Fix a Failed Lifetime SSL Installation
  • How to Redirect HTTP to HTTPS
  • How to Monitor System Processes Using htop Command
  • Varnish vs Nginx FastCGI Cache: Which is Best for WordPress?
  • What Is the Database information_schema on phpMyAdmin?
  • How to Disable WP-Cron for Faster Performance
  • How to fix the ERR_SSL_PROTOCOL_ERROR
  • How to fix the NET::ERR_CERT_AUTHORITY_INVALID error
  • How to Add Expires Headers in WordPress
  • How to fix the “There has been a critical error on your website” error
  • How to Fix ERR_QUIC_PROTOCOL_ERROR in Chrome Browser
  • What Is Localhost? And How Does It Apply to WordPress?
  • How to Fix a Mixed Content Warning on Your Website
  • How to Fix the "Connection Timed Out" Error in WordPress
Powered by GitBook
On this page
  • Step 1: Install and Activate WP Rocket
  • Step 2: Log in to WordPress Admin
  • Step 3: Remove W3 Total Cache
  • Step 4: Install WP Rocket
  • Step 5: Configuring WP Rocket
  • Step 6: LazyLoad and Minification
  • Conclusion

Was this helpful?

How to Configure WP Rocket Plugin for WordPress

PreviousDeploying Web Applications with NGINX HTTP ServerNextHow to Check SPF and DKIM Records with WeWP

Last updated 11 months ago

Was this helpful?

WP Rocket is a popular WordPress plugin designed to optimize your website's performance and speed. This guide will walk you through the simple steps to configure WP Rocket for optimal performance.

Step 1: Install and Activate WP Rocket

  1. Purchase and Download:

First, you need to purchase WP Rocket from their official website. After purchasing, download the plugin file to your computer.

2. Download the Plugin:

  • After purchasing, download the WP Rocket zip file to your computer.

Step 2: Log in to WordPress Admin

  1. Access WordPress Admin Area:

  • Open your browser and navigate to your WordPress login page (usually yourwebsite.com/wp-admin).

  • Enter your username and password to log in.

Step 3: Remove W3 Total Cache

  1. Deactivate and Delete W3 Total Cache:

  • Go to Plugins > Installed Plugins in your WordPress dashboard.

  • Find W3 Total Cache, click Deactivate, and then click Delete.

  • Remove any other optimization plugins to prevent conflicts with WP Rocket.

Step 4: Install WP Rocket

  1. Upload WP Rocket Plugin:

  • In your WordPress dashboard, go to Plugins > Add New.

  • Click on the Upload Plugin button at the top.

  1. Install the Plugin:

  • Click Choose File, select the downloaded WP Rocket zip file, and click Install Now.

  1. Activate the Plugin:

  • Once installed, click Activate Plugin.

  • License activation happens automatically, so there's no need to enter an API key.

Step 5: Configuring WP Rocket

  1. Default Settings:

  • Upon activation, WP Rocket automatically enables page caching, browser caching, GZIP compression, and other performance enhancements. These rules are added to your .htaccess file.

  1. Varnish Cache Purge:

  • If Varnish is enabled on your server (default on WeWP), go to the Varnish tab in WP Rocket and check Enable the Varnish caching auto-purge.

  1. Purge OPCache:

  • WeWP provides OPCache, and you'll see a Purge OPCache link in the WP Rocket admin toolbar if you need to clear it.

  1. Purge Varnish When Using a Proxy:

  • When using a proxy service like Cloudflare, clearing the Varnish cache might not work effectively. Use the following steps to fix this:

  1. Creating a Custom File:

  • Create a folder named mu-plugins in your wp-content directory if it doesn't already exist.

  • Create a new file using a basic text editor and add the following code:

<?php

defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );

/**

* Plugin Name: Fix Varnish Auto Purge with Proxy and WP Rocket

* Author: WP Rocket Support Team

* Author URI: http://wp-rocket.me/

* License: GNU General Public License v3 or later

* License URI: http://www.gnu.org/licenses/gpl-3.0.html

*/

add_filter( 'rocket_varnish_purge_request_host', '__rocket_varnish_custom_hostname' );

function __rocket_varnish_custom_hostname() {

return 'example.com';

}

add_filter( 'rocket_varnish_ip', '__rocket_varnish_custom_ip' );

function __rocket_varnish_custom_ip() {

return 'localhost';

}

  • Replace example.com with your domain name.

  • Save the file as wp-rocket-varnish-purge-proxy.php.

  • Upload this file to the mu-plugins folder.

  1. Re-activate WP Rocket:

  • Deactivate and reactivate WP Rocket, and manually clear the cache of your proxy if necessary.

  1. Verify Varnish Cache Clearing:

  • Open Developer Tools in Chrome (Ctrl+Shift+I or Menu > More Tools > Developer Tools).

  • Click the Network tab and reload your website.

  • Check the Age header value. After purging, it should reset to 0.

Step 6: LazyLoad and Minification

  1. Enable Features One-by-One:

  • In WP Rocket settings, enable LazyLoad and minification options one-by-one.

  • Check your site in a logged-out window to ensure there are no display issues.

  1. Consult Documentation if Issues Arise:

  • For any problems with LazyLoad or minification, refer to the WP Rocket documentation:

    • LazyLoad Documentation

    • Minification Documentation

  1. Disabling Problematic Options:

  • If issues persist, disable the option and clear the cache to revert your site back to normal.

Conclusion

Configuring WP Rocket on your WordPress site is a straightforward process that can significantly enhance your site's speed and performance. By following the steps outlined in this guide, you will:

  1. Download and Install WP Rocket efficiently.

  2. Remove Conflicting Plugins like W3 Total Cache to ensure WP Rocket runs smoothly.

  3. Activate and Automatically Apply essential caching and performance optimizations.

  4. Configure Varnish Cache settings for better integration with proxies like Cloudflare.

  5. Enable and Test LazyLoad and Minification settings to further optimize your site's load times without causing display issues.

  6. Add URL Exclusions to ensure smooth operation of WP Rocket’s minification process alongside Varnish.

By taking these steps, you will ensure that your WordPress site runs faster, providing a better experience for your visitors. Regularly monitor your site’s performance and make adjustments as necessary to maintain optimal speed and efficiency. With WP Rocket, you are equipped with powerful tools to keep your site running smoothly and quickly.