LearnDash breaks my website – what can I do?

Written by Mark Langdale

5 October 2021

The “LearnDash LMS Tips & Tricks” Facebook forum is a brilliant place to go if you have any questions or issues related to LearnDash.

We recently spotted an issue from a LearnDash user whose website broke whenever they activated LearnDash:

LearnDash issue

Whenever they activated LearnDash they were faced with a blank white screen, commonly referred to as “The white screen of death”.

You might also experience something like this if WordPress is able to partially load before the site breaks:

What’s causing the error?

Your WordPress / Learndash site is made up of thousands upon thousands of lines of code. Some of these are from LearnDash developers, some are from the developers of plugins you use.

If just one of these lines of code has issues with it, the PHP compiler (the thing that turns the 1’s and 0’s into a your lovely LearnDash system) will have trouble understanding the code and will collapse in a heap. This results in either a blank white screen or an error message.

It’s important to note that it isn’t necessarily LearnDash that’s breaking your site. More often than not it’s caused by other plugins, some of which may conflict with one another.

What can I do?

Don’t panic. When you have an issue on your site, the worst thing you can do is to immediately start deleting things or reverting to backups unnecessarily.

Identifying the issue

1. Check your server’s PHP error logs

The webserver that hosts your LearnDash LMS will most likely be keeping logs of all access and errors that happen on your site. One of the best places to look for any issues that are happening on your site is your server’s PHP error log.

Depending on your setup, this could be found in a number of places.

If you are on shared hosting with CPanel, there’s an “Errors” option in the interface:

If you are on shared hosting without CPanel, but have access to your webserver via FTP, look for a folder called public_html. Within here you might find some “error_log” files, which will store any site related errors. Failing that, navigate outside of the public_html folder and look for a folder like “logs”.

If you are on some hosting that you’ve set up yourself, then you probably don’t need me to tell you where your PHP logs are – but most likely places are:

Linux

/var/log/httpd/error_log

/var/log/apache2/error.log

Windows

C:\log_files\php_errors.log

When you’ve opened your error logs, look out for the terms “Fatal error” or “Parse error”. If you find any of these, it will tell you which file has the error and where:

PHP Code

2. Enable WordPress debugging

If you have access to WordPress’ files on your server, you can enable debugging from here. This will show you details about any errors that are causing problems with the display of your LMS.

Firstly, open the file wp-config.php, which is in the root directory of your WordPress installation.

Now find the line that looks like:

 define( ‘WP_DEBUG’, false );

From here, you can either simply change this to 

define( ‘WP_DEBUG’, true );

Which would cause any errors to be displayed on screen when you load your LMS:

Fatal error

Or an even better option is to set this to true, but also add the following lines:

define( ‘WP_DEBUG_LOG’, true );

define( ‘WP_DEBUG_DISPLAY’, false );

This will mean that your error messages are stored in a log file rather than being shown on your site. The error messages can contain information about your server, so it’s best not to make these available to people who might use it maliciously.

If you add these lines, you’ll end up with a “debug.log” file within your /wp-content/ folder that will contain any errors.

Be sure to set the debug settings back to false in your wp-config.php file when you’re done, and delete the debug.log file that gets created inside your /wp-content/ folder

3. Troubleshoot your plugins

If you weren’t able to access your error logs or determine the error from them, then you can troubleshoot your plugins by systematically disabling them.

You’ll need access to your webserver, to do this. Head to your WordPress directory on your webserver using FTP open the /wp-content/ folder. Within here you should find a directory called “plugins”, along with some others like “uploads”.

Rename your plugins directory “plugins.hold”.

Refresh your WordPress / LearnDash site and you should (hopefully) now find that it is functional.

Log into your site, then head to Plugins and you should see a message saying that your plugins have been deactivated (since they can no longer be found):

Now rename the plugins directory back to what it was – so change it from plugins.hold back to plugins.

Now refresh the plugins page and you’ll find that all your plugins are back, but disabled:

Now re-enable these plugins one by one until your site breaks again. Once it does, take note of the plugin you just enabled.

You can repeat the process, and re-enable all plugins apart from the one that caused the issue.

4. Check for plugin or theme updates

If you’ve used the steps above, you may find that it is a plugin that’s causing your issues. If plugin or theme developers push out updates with bugs, then they are often reported and fixed quite quickly – so you might find that there’s already an update available.

Within your WordPress dashboard, click on this icon to find any plugins or themes that need updating:

Then select any plugins or themes you want to update and click “Update Plugins” or “Update Themes”:

Hopefully once the plugins update the issues might be resolved!

It’s rare that popular plugins like LearnDash will cause problems like this on your site, but depending on your setup and other plugins that you use you might see this from time to time. We hope these steps will help you to get things back on track. If they help you, or you have any tips of your own we’d love to hear from you in the comments.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Other blog posts you may be interested in…