WordPress Bug Fixing [GUIDE]

Written by Tom Herudek
 — September 30th, 2022 — Freelancing / General / WordPress

Experiencing bugs in WordPress is quite common for most users. In this guide, we'll outline some steps you can take to identify and fix the bugs on your WordPress site.

Types of bugs in WordPress

There are different types of bugs in WordPress. Some make your site look weird - they tend to be more front-end. Others make it not work at all - they are more of code issues or database errors. We can divide it into these 2 parts:

  • PHP Errors
  • JavaScript Errors

PHP Errors in WordPress

These are the most common type of errors on WordPress sites. They happen when there is an error in your code. And they put your site down and make it unusable. Sometimes you can see, that the site is "cut in half", or just rendered partially. If you don't have error reporting enabled - they cause the infamous white screen of death.

What causes PHP errors in WordPress?

Mostly these errors are caused by a plugin or a theme that you have installed. Usually, it happens, when you actualize them or make changes on your website. They can also be caused by your own code. Typically while adding snippets to your functions.php file.

How to diagnose PHP errors in WordPress?

Errors are usually suppressed on production servers. First thing you need to enable WP Debug. So your errors will be printed in the log file and/or on your website. In the logs you can see the description of the error. Usually, it helps you to narrow the issue to a plugin/theme/snippet code in functions.php.

How to fix PHP errors in WordPress?

If the error is caused by a plugin or a theme - you can try to deactivate it. If you don't have access to your WP Admin screen, simply rename the folder with plugin or theme. For example, the plugin is in the folder yoursite.com/wp-content/plugins/advanced-customfield-pro/. Then change the plugin to yoursite.com/wp-content/plugins/advanced-customfield-pro-OLD/. This will de-activate it.
If the error is in your code, you need to find and correct the mistake. Sometimes this can be as easy as forgetting to close a curly bracket. Or adding a semicolon at the end of the line.

Javascript errors in WordPress

JavaScript errors make your website look broken. Some features stop working or look weird. For example, you can't open the menu, accordions are not expanding. Sliders are not sliding. Sometimes you see a pop-up saying "this site is having issues" in the browser console.

What causes JavaScript errors in WordPress

Most of the time, it's a conflict between different scripts running on your website. Sometimes it can be an error in your code. Plugins tend to include their own JavaScript. If one item is written poorly, it can disable the execution of all javascript.

How to diagnose JavaScript errors in WordPress

Open your browser console. In Chrome you do this by opening the Developer Tools (Ctrl+Shift+C on Windows, Cmd+Opt+C on Mac). Go to the Console tab. Look for any error messages. You are basically trying to see the red messages. They mean errors. If you dig a bit deeper into them, you'll be able to see which script causes them.

How to fix JavaScript errors in WordPress?

Make sure that all plugins, theme, and WordPress is up to date. You would be surprised how many JavaScript errors can be sorted simply by updating the whole site. If this doesn't help, you can either try to de-activate the problematic plugins. Or hire a WordPress developer. There is not that much between.

medium_844e904c0ed2e9f86618d95e35297389

About the Author

Hi! My name is Tom Herudek and I help my clients with their WooCommerce stores.
Learn more

Discuss with me!