How to make Lead Booster Pro work with WP Rocket?

Maximilian Wolf
Founder of Lead Booster Pro

If you’re using Lead Booster Pro forms on your website along with the WP Rocket caching plugin, you might encounter issues where the forms do not load or function correctly. This is due to WP Rocket’s optimization features interfering with the Lead Booster Pro scripts.

This guide will walk you through the steps to configure WP Rocket to work seamlessly with Lead Booster Pro by excluding its scripts from certain optimizations.

Understanding the issue

WP Rocket optimizes your website’s performance by minifying, combining, deferring, and delaying the execution of JavaScript files. While these optimizations improve load times, they can interfere with scripts like Lead Booster Pro’s embed code, which requires immediate and unaltered execution to function properly.

By default, WP Rocket may:

  • Modify the Lead Booster Pro scripts: Changing the script can break its functionality.
  • Defer the script loading: This can cause the script to load after the page has finished parsing, leading to errors.
  • Delay the script execution: The script might not run until user interaction, which isn’t suitable for forms that need to load immediately.

Steps to configure WP Rocket

To ensure that Lead Booster Pro works correctly, you’ll need to exclude its scripts from WP Rocket’s optimization processes.

1. Exclude scripts from minification and combination

Minification removes unnecessary characters from code without changing its functionality, while combination merges multiple scripts into one. Both can interfere with external scripts.

Steps:

  1. Access WP Rocket Settings:
    1. Log in to your WordPress admin dashboard.
    2. Navigate to Settings > WP Rocket.
  2. Go to the File Optimization Tab:
    1. Click on the “File Optimization” tab.
  3. Exclude the Lead Booster Pro Scripts:
    1. Under JavaScript Files: Find the sections for “Minify JavaScript Files” and “Combine JavaScript Files”.
    2. Add Exclusion:
      1. In the “Exclude JavaScript Files” fields (for both minification and combination), add the following line:
        app.leadboosterpro.io
      2. This wildcard pattern ensures that any script from app.leadboosterpro.io is excluded from minification and combination.
  4. Save Changes:
    1. Click on the “Save Changes” button at the bottom of the page.

2. Exclude scripts from deferred loading

Deferring JavaScript means loading scripts after the initial page load, which can cause Lead Booster Pro scripts to fail if they are needed immediately.

Steps:

  1. Still in the File Optimization Tab:
    1. Scroll down to the “Load JavaScript Deferred” section.
  2. Exclude the Lead Booster Pro Scripts:
    1. In the “Excluded JavaScript Files” field, add: app.leadboosterpro.io
  3.  Save Changes:
    1. Click on “Save Changes” if you haven’t already.

Verifying the configuration

After updating the settings, it’s essential to ensure that everything works correctly.

Steps:

  1. Clear WP Rocket Cache:

    1. Go to WP Rocket > Dashboard.
    2. Click on “Clear Cache”.
  2. Test Your Website:

    1. Visit the page(s) where your Lead Booster Pro forms are embedded.
    2. Ensure that the forms load correctly and are fully functional.
  3. Check for Console Errors:

    1. Open your browser’s developer tools (usually by pressing F12).
    2. Look for any JavaScript errors in the console that might indicate issues.

Conclusion

By excluding Lead Booster Pro scripts from WP Rocket’s optimization features, you ensure that your forms load and function correctly without sacrificing the overall performance benefits WP Rocket provides. This configuration allows both plugins to coexist harmoniously, providing a seamless experience for your website visitors.

FAQ

Excluding a few essential scripts like those from Lead Booster Pro will have a minimal impact on your site’s performance. The benefits of the forms working correctly outweigh the negligible performance difference.

Yes, if you prefer to target a specific script, you can use the exact URL, such as: https://app.leadboosterpro.io/form/iframe.js.

However, using a wildcard ensures that any current or future scripts from Lead Booster Pro are also excluded.

These settings should persist through updates. However, verifying your configurations after major plugin updates is a good practice.

If problems persist:

  • Ensure that all caching (including browser cache) is cleared.
  • Check for conflicts with other plugins.
  • Contact Lead Booster Pro support for further assistance.

While not recommended in this case, you could try adjusting the script loading order or using custom code to ensure scripts execute properly. However, excluding the scripts is the most straightforward and reliable solution.