Your WordPress logs are like an archive of all kinds of information, but they’re particularly important for helping you to track down error messages and what could be causing them. WordPress logs aren’t enabled by default, but it’s easy to get to them and enable them, even if you’re not a programming expert.
The first step to enabling your WordPress logs is to access your site via FTP. You can often do this directly from your web hosting control panel. Once you’re inside, you’ll want to look for your wp-config file and enable your WordPress logs from there. Sounds simple enough, right? Let’s go through it step by step.
Why Enable WordPress Logs?
Despite all that WordPress is capable of, it is not a perfect system. With so many themes, plugins and bolt-on systems designed to use WordPress’ innate capabilities and then expand on them, there are bound to be conflicts.
Sometimes plugins and themes don’t always get along, and with the wide range of developers out there putting out new stuff all the time, it’s inevitable that there are going to be issues. With WordPress, no matter how clean and organized you keep it, the question is not if, but when a conflict occurs.
For this reason, it’s a good idea to enable WordPress logs, if nothing else, than to be able to give your developer or WordPress manager an inside look at what’s happening behind the scenes. Plus, if you ever venture over to the WordPress forums to ask a question, chances are they’ll ask you for your logs as well. Before we jump right in and enable your logs so that you can download and share them, you’ll want to take one very important step before the rest:
First, Make a Backup
We’re going to be editing a crucial WordPress file – the file that basically tells WordPress how to WordPress. So you’ll want to make a full backup of your site just in case. Once you’ve got your backup, the next step is to get into the inside of your site by way of FTP.
FTP stands for File Transfer Protocol and it’s how files are uploaded to your website. You can usually find this within your hosting control panel. Check the welcome email that your host has sent you for the host, username and password. If you can’t find FTP in your control panel, you can download Filezilla, which is a free FTP software. You’ll need those same credentials: host, username and password, to login.
Once you’re in, look for the directory where your WordPress website is stored. It could be called root, or www or example.com if example.com is your domain name. Double click to open it. A long list of files and folders will open up (who knew there were so many components needed just to run WordPress?) but the one you’ll want to look for is called wp-config.php
This is a very important file and is, essentially, the brain of your WordPress website. Right click on this file and choose View/Edit. It will open up in your computer’s default text editor. What’s interesting about this is that it has been designed in such a way to allow programmers to edit it should the need arise.
Enabling WordPress Logs
Now, look for a line that says: /* That’s all, stop editing! Happy blogging. */.
Before that line, copy and paste the following code
define( 'WP_DEBUG', true );
You may already have this line of code present in your wp-config file, but it’s likely set to “false”. You just need to change that to true.
What this does is enable WordPress’ debugging mode, which will cause it to start tracking errors. However, just tracking the errors internally isn’t going to be enough, because you want to be able to see those logs too. So after that line of code, add this one:
define( 'WP_DEBUG_LOG', true );
This line of code essentially tells WordPress to not only enable the debugging mode, but also keep a log of any issues it comes across. Ta-da! This is your WordPress logs file.
I’ve Got Logs Enabled, Now What?
Keep in mind that enabling these logs aren’t going to track past issues. So if there’s a recurring problem that has been giving you grief, you’ll need to recreate or trigger the issue again to make WordPress log it from this point forward.
Now, although it might seem like a good idea to keep your logs on all the time, you should turn them off again when you’ve fixed the problem. The reason is because WordPress will log everything, even inconsequential things, and doing that over time can slow down your site a lot. So once the problem is resolved, it’s a good idea to turn them back off again (just by setting those “true” points to “false” and getting back to growing your WordPress website.
Another point to keep in mind is that enabling WordPress logs assumes that you’re somewhat tech-savvy and you know how to read them and what the error messages mean. If you don’t know or you’re not exactly sure, no problem! WPDandy can help. Even if you’re not comfortable enabling your log files, we can take care of that too, enabling us to troubleshoot the problem and work to fix it.
Enabling WordPress Logs: Getting the Info You Need
The bottom line is that your WordPress logs, once you know how to enable them and where to find them, can open up a lot of information about error messages and other issues that users may be having accessing your site. Having a knowledgeable and skilled development team with experience working with WordPress can also help you make sense of the error messages and remedy them.
If you’re encountering several problems, just enabling log files may not be enough. It may be worth having a dedicated team on your side to help troubleshoot and resolve problems while keeping your WordPress site up and running without any problems. Contact us today to learn more.