WordPress Troubleshooting: How to Solve Common WordPress Errors

Last updated on July 7th, 2024 at 10:46 am


Are you tired of dealing with pesky WordPress errors? Here are some WordPress troubleshooting tips that might help!

wordpress gears

Image by Tumisu from Pixabay

This post may contain affiliate links. We may earn a commission if you purchase an item through our links. It costs you nothing and helps us to fund this blog. Please see our Affiliate Disclosure & Notification for details.

WordPress Troubleshooting: How to Solve Common WordPress Errors

WordPress is a popular content management system (CMS) used by millions of websites around the world. While WordPress is generally a reliable platform, it’s not uncommon to run into issues from time to time.

These errors can be frustrating and cause your website to go down or become inaccessible. In this article, we’ll explore some of the most common WordPress errors and how to fix them.

Frustrated laptop computer user, top view mock up copy space. Used in WordPress troubleshooting.
Errors on your WordPress website can be frustrating

Determine the Cause of the Issue

When you’re website errors out on certain pages, or throws up an error message, the first thing you should do is attempt to identify the cause of the issue. A couple quick questions to ask yourself:

  • Did I install any new plugins?
  • Did I activate a new theme?
  • Did I change a setting on my hosting account?

After you’ve answered those questions, it’s time to start investigating.

Check Your Admin Email

WordPress does a pretty good job of notifying you when there’s a problem. If you get the dreaded, “There has been a critical error on this website” message, your site probably sent an email to you with the error details. These details are the key to the issue that caused your site to crash. Here’s an example of such an email that we got when after installing a new plugin:

Howdy!

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, Auto Amazon Links.

First, visit your website (https://cgscomputer.com/) and check for any visible issues. Next, visit the page where the error was caught (https://cgscomputer.com/wp-admin/edit.php?post_type=amazon_auto_links) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can’t access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.

https://cgscomputer.com/wp-login.php?action=enter_recovery_mode&rm_token=REDACTED

To keep your site safe, this link will expire in 1 day. Don’t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.3.2
Active theme: Astra Child (version 1.0.0)
Current plugin: Auto Amazon Links (version 5.3.4)
PHP version 8.1.24



Error Details
=============
An error of type E_ERROR was caused in line 62 of the file /home4/cgscomputer/public_html/wp-content/plugins/amazon-auto-links/include/library/apf/factory/_common/_abstract/_controller/AdminPageFramework_Resource_Base.php. Error message: Uncaught TypeError: Illegal offset type in isset or empty in /home4/cgscomputer/public_html/wp-content/plugins/amazon-auto-links/include/library/apf/factory/_common/_abstract/_controller/AdminPageFramework_Resource_Base.php:62
Stack trace:
#0 /home4/cgscomputer/public_html/wp-includes/class-wp-hook.php(310): AmazonAutoLinks_AdminPageFramework_Resource_Base->_replyToModifyEnqueuedAttributes(‘https://docs.ad…’, Object(ACTypeUrlDocumentation), ‘display’)
#1 /home4/cgscomputer/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘https://docs.ad…’, Array)
#2 /home4/cgscomputer/public_html/wp-includes/formatting.php(4566): apply_filters(‘clean_url’, ‘https://docs.ad…’, Object(ACTypeUrlDocumentation), ‘display’)
#3 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/templates/table/tooltip-saved-filters.php(13): esc_url(‘https://docs.ad…’)
#4 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/admin-columns/classes/View.php(82): include(‘/home4/cgscompu…’)
#5 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/admin-columns/classes/View.php(95): ACView->resolve_template()
#6 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/templates/table/segment-modal.php(24): ACView->render()
#7 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/admin-columns/classes/View.php(82): include(‘/home4/cgscompu…’)
#8 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/admin-columns/classes/View.php(95): ACView->resolve_template()
#9 /home4/cgscomputer/public_html/wp-content/plugins/admin-columns-pro/classes/Search/TableScreen.php(90): ACView->render()
#10 /home4/cgscomputer/public_html/wp-includes/class-wp-hook.php(310): ACPSearchTableScreen->add_segment_modal(”)
#11 /home4/cgscomputer/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#12 /home4/cgscomputer/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#13 /home4/cgscomputer/public_html/wp-admin/admin-footer.php(78): do_action(‘admin_footer’, ”)
#14 /home4/cgscomputer/public_html/wp-admin/edit.php(510): require_once(‘/home4/cgscompu…’)
#15 {main}
thrown

You can see under the error details, the first line mentions the Amazon Auto Links plugin. And it makes sense that this means that plugin is most likely the source of the issue. However, if you look further down in the error message, you’ll see a reference to Admin Columns Pro as well – which could indicate a possible plugin conflict between the two.

Enable WordPress Debugging

Enabling the debugging feature in WordPress allows you to log the errors generated by your site to a file in real time where you can view them. You can enable the debugging log by adding the following lines to your wp-config.php file:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

The first line pair turns on debugging mode. The 2nd pair tells WordPress to write all the error messages to a file called debug.log located in your wp-content directory. Finally, the 3rd line tells WordPress not to display the errors on the front end of your website.

Alternatively, you can set WP_DEBUG_DISPLAY to true and your site will display the errors right in the web browser. You want to be careful here though because if this is a live production site, your visitors will also see any error messages which might turn them away from using your site or even expose information to hackers about your site architecture that would otherwise be hidden.

When you do enable debugging and look at the debug.log file, you’ll see the same type of error messages shown in the previous email under the error details section.

Enable PHP Error Logging

Another way to get errors from your WordPress site is to enable PHP error logging. You can do this by modifying the PHP configuration file which will either be php.ini or user.ini depending on your web server configuration. Add the following lines to the file:

error_log = "/logs/php-errors.log"
error_reporting = E_ALL

This code tells PHP to log all errors to a file called php-errors.log inside the /logs/ folder. Again, just like debugging mode in WordPress, the error will be exactly the same in this log as it would be in the error details from the email above.

It’s important to not that when you set up PHP error logging in this way, you’ll not only see critical errors that cause website problems, but you’ll also be able to see any warnings or informational events that may not necessarily indicate an issue with your site.

Computer showing hacking alert and critical error message flashing on screen - WordPress troubleshooting - WordPress errors
No one wants to see an error screen

What Causes WordPress Errors?

WordPress errors can be caused by a variety of factors including outdated plugins or themes, conflicts between plugins, server issues, or problems with the WordPress core files.

Keeping your WordPress installation up-to-date and regularly checking for updates to your plugins and themes can help prevent many common errors from occurring. However, even with diligent maintenance, errors can still happen.

Out of Date Plugins

Plugins that don’t get updated frequently can be found to have many problems. Not only are old plugins bad for WordPress security, they’re also bad for performance.

Old plugins might not work with newer faster versions of PHP or they might not even work properly with the current version of WordPress at all. A good rule of thumb is if a plugin hasn’t gotten an update in over a year, you can pretty much consider it abandoned by the developer and it’s time to start looking for a replacement.

Out of Date Themes

Old and out of date themes cause the same types of problems that old plugins cause. They’re bad for WordPress security and they might not be capable of playing nicely with all the newer components of WordPress.

Again, just like plugins, if the theme hasn’t been updated in over a year, it’s probably time to start thinking about a replacement.

Plugin Conflicts

This is probably one of the more common causes of WordPress errors. There are thousands upon thousands of WordPress plugins out there and it would be impossible for a plugin developer to test their plugin for compatibility with all of them. So it goes without saying that these conflicts come up relatively often, especially if your website has many plugins.

In this case, it might not be your problem to fix – but you can certainly help out the plugin developer by providing them with the error messages so they can research and hopefully fix the incompatibility in a future version of their plugins. Most reputable developers will attempt to fix conflicts because they want their product to be useful.

Incompatible PHP Version

An often overlooked issue on many older websites is when PHP has not been updated in a while. If you’re using an unsupported version of PHP, there’s a really good chance that the plugins you’re using aren’t guaranteed to work with it. You can head over to php.net to find out what the currently supported versions of PHP are. Make sure those are the ones you’re using on your website.

Incidentally, outdated versions of PHP also contain numerous security vulnerabilities and can put your website and your customer data at risk. So even if you aren’t experiencing errors, checking your PHP version regularly is one of the most important WordPress best practices.

Isolate the Problem

Assuming your website is still accessible and not completely crashed, it’s important to isolate which conditions will trigger the error you’re seeing. Years ago, that meant disabling all your plugins and enabling them one by one until the error popped back up. At that point, you’d know which plugin was the culprit. But doing this could mean breaking your website for your visitors and so the WordPress troubleshooting process could be very disruptive.

Using the Health Check & Troubleshooting Plugin

Fortunately, a few years ago, a new plugin was created that helps to mitigate the disruption when troubleshooting errors on live production sites. The Health Check & Troubleshooting plugin is a very useful plugin that allows you to disable plugins & themes for your session only. This means that your customers and site visitors won’t see anything different – but you can still troubleshoot deactivating plugins yourself and fix WordPress errors fast.

I have found that this plugin is really useful when troubleshooting WordPress errors because I can be confident I’m not hurting my site visitors while I do my investigations.

Solutions for Plugin Errors

Plugin errors can cause a wide range of issues with your website, from display problems to complete crashes. One way to resolve plugin issues is to disable the problem plugin and see if the issue is resolved. If not, you may need to look for conflicts between plugins. You can also try updating the plugin to the latest version.

It could also be possible that you have stumbled onto an issue with the plugin for which the developer is not yet aware. In this case, reaching out the developer may be the best way to get a real fix.

Troubleshooting Theme Issues

Issues with your WordPress theme can cause problems with your website’s appearance, functionality, or both. If you’re experiencing issues with your theme, try switching to a default WordPress theme to see if the issue persists. You can also try updating your theme to the latest version.

Contacting the theme developer for support is a common method of fixing theme issues. Most reputable developers are enthusiastic about making sure their themes work for everyone.

How to Resolve Database Connection Errors

Database connection errors can occur when there is a problem with the connection between WordPress and your database. One possible cause of this error is an incorrect database login or password. Double-check your database login credentials to make sure they are correct. If the issue persists, try repairing your database using a tool like phpMyAdmin.

Final Thoughts on WordPress Troubleshooting

While WordPress errors can be frustrating, they are usually fixable with a bit of troubleshooting. By following the steps outlined in this article, you should be able to resolve many common WordPress errors and keep your website running smoothly.

Remember to keep your WordPress installation and plugins up-to-date to lower the chances that you’ll have to fix WordPress errors in the first place.

FAQs

 | Website

Sharif Jameel is a business owner, IT professional, runner, & musician. His professional certifications include CASP, Sec+, Net+, MCSA, & ITIL and others. He’s also the guitar player for the Baltimore-based cover bands, Liquifaction and Minority Report.

Leave a Comment

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


Subscribe to Our Mailing List

If you found the information in this post helpful, we'd love to have you join our mailing list. We promise we won't spam you, we only send out emails once a month or less.


Scroll to Top