Broooo! You came to the right place. Sit down, grab your coffee, ‘cause I’m about to drop some WordPress debugging wisdom on you, like a real WP Sensei.
Debugging WP can feel like chasing a ninja bug in the dark, but I’ll give you the flashlight and the sword. Let’s roll!
🟢 Step 1: Turn On Debug Mode (The Jedi switch)
WordPress has its own debug system. You just gotta flip the switch in your wp-config.php.
Go to the root of your installation and look for this file:
arduinoCopiarEditarwp-config.php
Add or edit these lines like a real dev:
phpCopiarEditardefine('WP_DEBUG', true); // Turns on debugging
define('WP_DEBUG_LOG', true); // Saves errors to /wp-content/debug.log
define('WP_DEBUG_DISPLAY', false); // Hides errors from showing on screen (so users don't freak out)
@ini_set('display_errors', 0); // Makes sure errors don't show
The log will be here:/wp-content/debug.log
You can tail it like a hacker:
bashCopiarEditartail -f wp-content/debug.log
👀 Now you can see what’s breaking without ruining your front-end.
🔥 Step 2: Check for Plugin & Theme Conflicts (The Detox Process)
When something’s funky, it’s usually one of these two troublemakers:
- A plugin is misbehaving.
- Your theme is coded like spaghetti.
How to check:
- Deactivate all plugins.
If the issue disappears, turn them back on one by one to catch the villain. - Switch to a default theme (like Twenty Twenty-Four).
If it fixes things, your theme needs therapy.
⚠️ Step 3: Enable PHP Error Reporting (For deeper madness)
If you’re working locally or on a dev server:
phpCopiarEditarini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
This is like turning on X-ray vision.
You’ll see all the nasty warnings and errors PHP is hiding.
🧩 Step 4: Query Monitor Plugin (My favorite bro-tool)
Query Monitor is the king of WordPress debugging plugins.
It shows:
- Slow queries
- PHP errors
- Hooks & Actions
- HTTP API Calls
- Enqueued Scripts & Styles
- REST API Calls
Install it, activate it, and you’ll see a debug bar on your admin top bar like a WordPress superhero.
🚀 Step 5: Browser Console & Network Tab
If your JS or AJAX is failing, bro… hit F12 and open the Console + Network tab.
Check for:
- 404 errors
- CORS issues
- Failed API calls
🟣 Bonus Brou Tips:
- Use LocalWP or DevKinsta to test without risking your production site.
- Keep an eye on your PHP version. Some plugins break on newer versions.
- Always back up before debugging. Debugging without a backup is like bungee jumping without the cord. 😱
🐞 Summary: The Debug Flow
- Enable WP_DEBUG & check debug.log
- Deactivate plugins → Check
- Switch theme → Check
- Enable PHP error reporting → Check
- Install Query Monitor → Profit 💰