WordPress websites using LearnDash are powerful online learning platforms that include a lot of dynamic content: courses, quizzes, surveys, video lessons, certificates, and more. However, this kind of functionality places a significant load on the server and can negatively impact site performance as well as Core Web Vitals, especially when the number of active users increases. Optimizing these types of sites is not just a good idea – it’s essential.
To optimize LearnDash sites (as well as regular WordPress/WooCommerce sites), I recommend using reliable plugins such as WP Rocket and Perfmatters. These plugins help to effectively solve site optimization tasks, including LearnDash specific features such as managing logged-in users, dynamic content, multimedia elements, etc.
WP Rocket is the best choice for caching, as it offers you intuitive settings and support for a large number of additional helper plugins that make integration and configuration much easier for complex sites, including LearnDash. For example, it allows you to enable a separate cache for logged-in users, which is essential for educational platforms.
Perfmatters helps with advanced optimization by disabling unnecessary JS, CSS scripts, and features that can slow down your site. For example, with Script Manager feature, you can disable LearnDash scripts on pages where they are not needed, reducing server load.
Why is website loading speed important?
I will not elaborate on the general aspects, but will highlight the main reasons why fast site loading speed is crucial for the sites on LearnDash:
- User Experience. Slow loading pages annoy users, especially in educational projects where a comfortable and seamless interface experience is required. This can lead to decreased student engagement and even abandonment of your site.
- SEO. Search engines, including Google, take website load speed into account as one of the key ranking factors. This is especially important for educational platforms that want to stay competitive in the rankings.
- Indexing. The speed of your site affects how quickly your content is indexed. If your site loads slowly, new content or articles will take longer to appear in search.
Unique Challenges of LearnDash and Server Load
LearnDash sites have specific features that need to be taken into account when optimizing:
- Dynamic content generation. LearnDash generates personalized pages, test results, surveys, and other data. These processes require a large number of database queries, which increases the load on the server.
- High user activity. Simultaneous use of the site by multiple students results in load, especially when taking tests or loading lessons.
- Multimedia files. Video, audio, and images embedded in lessons can slow down page loading if they are not optimized.
- Additional plugins and integrations. Integrations with payment systems, forums, or analytics often require third-party plugins. Unoptimized plugins may significantly slow down your site.
LearnDash basic website optimization tips
Use a good hosting service. LearnDash is very demanding on resources (number of cores, allocated memory). I recommend Pressidium, which is good for high-load sites.
Consider a separate domain or subdomain. If you’re just planning to connect LearnDash, host the course pages on a separate server to minimize load on the main site.
Add Cloudflare. For a global audience, setting up a CDN will significantly speed up page loads.
Increase the memory limit. In the wp-config.php file, set memory_limit to at least 2000M.
Optimize your site. Good optimization of a WordPress site includes:
- Object cache
- Delay loading of JavaScript (WP Rocket or Perfmatters)
- Remove unused CSS (WP Rocket or Perfmatters)
- Local storage of fonts (Perfmatters)
- Optimize images. Use webp/avif formats and configure lazy-load for images/videos/frames.
Limit the number of plugins. Keep only plugins that are really necessary and avoid poorly optimized solutions.
Choose lightweight themes and builders. If you can’t do without a builder, use optimized solutions: Kadence, Oxygen, Genesis.
Store videos on third-party services. Host your multimedia files on Vimeo or YouTube to avoid overloading the server.
Now that we’ve covered the basics of LearnDash optimization, it’s time to dive into the specific optimization settings.
Optimization features for LearnDash
The main challenge of optimizing sites with LearnDash is that logged in users often experience disabled caching and optimization, which worsens Core Web Vitals metrics. Even if your site is fast for guests, it may load slower for authorized users. Therefore, sites that use LearnDash need to make additional optimization settings.
Configuring the Perfmatters plugin for LearnDash
Manage scripts through Script Manager
Disable the use of all LearnDash scripts and plugins on pages where they are not needed. For example, this could be blog pages, homepage, contact pages, course advertisement pages, etc. Usually LearnDash scripts are only needed on the following pages:
/my-profile/
/courses/
/lessons/
/topic/
/quizzes/
/my-course-notes/
Configuration for logged-in users
Do not enable the Disable for logged in users option in the Perfmatters settings. This may cause performance loss for logged-in users of the site.
Perfmatters>Tools>Plugin
Adding a snippet to exclude optimization on course pages
Add the following code to your child theme’s functions.php file to disable delayed script loading and removal of unused CSS on LearnDash pages for logged-in users. Replace the page IDs (7543 and 75604) with those used on your site.
// Disable delay for logged-in users
add_filter('perfmatters_delay_js', function($delay) {
if ( current_user_can('administrator') OR is_page( 7543 ) OR is_page( 75604 )) {
return false;
}
return $delay;
});
// Disable used CSS for logged-in users
add_filter('perfmatters_remove_unused_css', function($boolean) {
if ( current_user_can('administrator') OR is_page( 7543 ) OR is_page( 75604 )) {
return false;
}
return $boolean;
});
WP Rocket plugin settings for LearnDash
Exclude LearnDash pages from optimization.
Add the following paths to WP Rocket’s exclusions so that optimization does not affect LearnDash’s critical pages:
WP Rocket>Advanced Rules>Never Cache URL(s)
/courses/(.*)/
/lessons/(.*)/
/topic/(.*)/
/quizzes/(.*)/
/wp-admin/(.*)/
wp-login.php
/login/(.*)/
/my-profile/(.*)/
/my-account/(.*)/
Enabling cache for logged in users.
Be sure to enable caching for logged in users in WP Rocket settings.
WP Rocket>Add-ons>User Cache
Using the WP Rocket | Common Cache For Logged-in Users plugin.
Install the optional WP Rocket | Common Cache For Logged-in Users plugin. It creates a separate cache for logged-in users, which improves performance on LearnDash pages.
Conclusion
Implementing all of the above settings will allow you to optimize your LearnDash site and achieve good Core Web Vitals even with a large number of users. After applying all these settings, the page load time on one of the recent sites I optimized decreased from 5-6 seconds to just 1 second for logged in users.
Remember that successful optimization requires a comprehensive approach: proper hosting, plugin settings, multimedia optimization, and careful script management. If you still have questions or need help with your site configuration, I am always ready to help. Your site will be able to work quickly and efficiently, even under high load!
Leave a Reply