Is your goal to set up WordPress error logs for your site? In case you didn’t know, but the WP – config file is actually one of the most relevant files in the entire WordPress core. it actually even happens to have every single setting for your WordPress site and it is even an amazing debugging tool. When it comes to debugging, it is actually the process of completely locating and actually resolving all errors specifically from a specific program or even platform.
You can also watch the video tutorial:
Since WordPress is quite a well-known platform, it is a known fact that there seems to be loads of common WordPress errors which occur. These errors actually occur due to various things such as server issues, custom code, themes, plug-ins, and even other reasons. If you have an error log, it can improve all your chances of possibly resolving any type of errors in a fast way. So, let’s not waste any more time and move further when it comes to setting up WordPress Error Logs in WP- Config.
Why Should You Use An Error Log In WordPress?
When you run a WordPress website, any type of error can occur. But, if you do utilise an error log, it would actually have loads of benefits. The error log would actually help you in checking out which exact scripts are actually causing all the error messages. This would even help you in figuring out whether it is a plugin or theme and specifically, which one is it exactly. If you wanna figure out whether it is an error on your side or on the web host’s side, this is a good way to do so. In case you don’t actually see a script which is actually the cause of the entire problem, then it is clear that there are definitely a lot of things which could possibly go wrong on the web hosts’ side.
Since everyone knows that cyber attacks are becoming more frequent in today’s world, a lot of new security methods are actually being formed so that it can make the site security much better. When it comes to the various types of cyber attacks, DDOS attacks are very well-known. These are known for often overloading pretty much any server and would lead to crippling your entire site. Unfortunately, in a situation like this, neither you nor your web host can do much. It is also quite a common thing for servers to often stop working entirely or even end up having a momentary glitch. The reason for this could possibly be that your web host may be using outdated or old equipment. In case this is what is happening with you. you may wanna switch your web host.
How To Set Up WordPress Error Logs In WP-Config?
We will be showing you how to set up WordPress Logs in WP-Config. You don’t actually require any additional plugins to completely and properly accomplish this specific task. All you really require is complete access to your website’s cPanel, which is given by your web host as soon as you create an account.
It is suggested that you backup your entire website before you try and make any changes. This would actually make sure that if anything goes wrong by any chance, you would have the option to completely revert the old version of your site.
- Login to your cPanel.
- Tap on the given File Manager. It would provide you with complete access to every single file that is related to your site.
- Now, you have to go ahead and exactly locate the wp-config.php file.
- Further tap on the public_html directory.
- Now, you have to go and right click on the wp-config php file.
- Further go ahead and tap the Edit option that you would see.
- You would see a pop up that would warn you to create a backup of your entire site before you move further with editing anything else.
- Finally, you have to click on the Exit button. This would lead to a new tab opening which would contain all the codes from the file.
- You have to now scroll down to the bottom of the entire code. You have to search the comment line that would say “That’s all, stop editing! Happy Blogging.”
- Now, you are required to paste the given code right above it.
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ] define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); [/ht_message]
You may actually already see the first line in your code, but rather than the “true” value, you would see the “false” value. You are required to delete it right before you end up pasting this exact code in. This line would further lead to turning the WordPress debug mode on, even when the second one would simply just form a real log of every single error that you encounter.
As soon as you’re done inserting the code right in the functions.php file, you have to further tap on the “Save Changes” button to finally finish the whole thing.
You have officially learnt how to exactly enable the whole Debug Mode and set up the error log for your WordPress site. In case you have any more doubts or queries, feel free to check out our website or even reach out to us!