Themeisle content is free. When you purchase through referral links on our site, we earn a commission. Learn More Show
From conflicts between WordPress plugins to poorly coded themes and mistakes in custom coding, several problems sound the alarm with website error codes and warnings. Even if you’re not sure what the warnings mean, you must fix them. The first step is learning how to set up a WordPress error log. As a short explanation, a WordPress error log is exactly what it sounds like: a list of error codes and times that occur on your website. In this post, we’ll show you how to set up and work with WordPress error logs using the built-in WordPress debug mode. When should you set up a WordPress error log?Consider setting up a WordPress error log in the following situations:
As is often the case with WordPress, you have two routes to enable error logging with WordPress debug mode:
We’ll start by showing you the manual method, which just involves adding a few code snippets to your site’s Then, if you want an even simpler option for error logging, we’ll share a free plugin that can get the job done. Here’s how to do it manually… Click here if you’d rather jump to the plugin 👈 Step 1: Access and edit the wp-config.php fileIf you’re not familiar with your To access the How to use FTP to connect to WordPress 👈 For this tutorial, we’ll cover the steps to access and edit your In your FTP client, locate the Upon finding the file, right-click on it and select to edit or view the file. You’ll want to open the file in a text editor. Step 2: Add a line of code in the wp-config.php file to turn on debug modeInside your text editor, search for a line of text that reads Place your cursor on the empty line above that line of text. Paste in the following code:
If you already notice this line
of code in the file, it may currently be set to Afterward, save the file to your computer and upload the Great! Now debugging mode is activated for your WordPress site. Step 3: But wait! I don’t want the errors to show on the frontend of my websiteIf you took a moment to check your dashboard or the frontend of your site, you may have already seen WordPress errors listed for everyone to see. This may not seem like a big deal if they show up on the WordPress dashboard, but you definitely don’t want the warnings on the frontend. Not only is publicly displaying errors confusing for your visitors, but it can also be a security risk because it gives them detailed information about your site. In short, debugging mode is messy when activated by itself. Therefore, we need to log the errors in WordPress so they are recorded but not publicly displayed. To log your errors, go back to that exact same Look at the debug code you recently pasted into the file. Paste the following new code on the empty line below the debug code:
Again, in some situations you might discover that the debug log code is already included. For that, simply make sure that the The first line tells WordPress to save
error messages to a file called Now, your error messages will be safely saved in the log file, but neither you nor your visitors will have to see error messages while browsing your site. For a second time, save the How to use a WordPress error log pluginIf you don’t feel comfortable working directly with your site’s configuration file, you can also use the free WP Debugging plugin: As soon as you activate the plugin, it instantly activates WordPress debug mode and enables error logging. It also lets you control whether or not to display debug messages on your site by visiting Tools -> WP Debugging. Checking your WordPress error logsWe’re assuming you already know the website pages that are alerting you of errors. You must visit these pages now that the debugging log is configured and ready to store the errors. Reconnect to your website files using the FTP client. You can also connect via your host’s cPanel. Go to the Open that folder and look for a file called This is the file you created from the previous steps. What should I do with this debug log file?The Overall, a debug log file is for reference, not for editing. Therefore, you have to sift through the list of errors and warnings to identify what’s wrong with your site, theme, plugins, or code. For most people, the error log codes mean nothing. If anything, it’s closer to gibberish than English. However, you don’t want to forget about those errors. Your resolution steps should go like this:
How to fix issues that you discover in the error logUnfortunately, there’s no one-size-fits-all approach to fixing problems that you might discover in your site’s error log. However, we do have lots of existing posts on how to fix common WordPress errors:
If you’re still not sure how to fix the issues in your log file, you might want to hire a WordPress developer to do it for you – here are some tips to find the right developer. Do you have any questions about how to set up a WordPress error log?Even looking at bits of code feels intimidating for the average WordPress user. The good news is that setting up a WordPress error log only takes two small snippets of code. If you have trouble activating your WordPress error log, or questions on how to fix them, let us know in the comments below! Free guide5 Essential Tips to Speed Up Your WordPress SiteReduce your loading time by even 50-80% |