## WP Debug

Product: Monogram - Personal Portfolio WordPress Theme
URL: https://hub.jkdevstudio.com/docs/monogram/troubleshooting/wp-debug
Updated: 2026-09-06

WordPress has a built-in debug mode that logs errors to a file instead of displaying them on your site. This is the single most useful tool for diagnosing problems with any WordPress installation, including Monogram.

## Enabling Debug Mode

1. Connect to your site via **FTP/SFTP** or your hosting provider **file manager**
2. Open the `wp-config.php` file in your WordPress root directory
3. Find the line that says `/* That's all, stop editing! Happy publishing. */`
4. Add the following lines **above** that comment:

```php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
```

1. Save the file

Here what each line does:

<table style="min-width:50px;"><colgroup><col style="min-width:25px;"><col style="min-width:25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Constant</p></th><th colspan="1" rowspan="1"><p>Purpose</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>WP_DEBUG</code></p></td><td colspan="1" rowspan="1"><p>Turns on debug mode - WordPress starts tracking errors</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>WP_DEBUG_LOG</code></p></td><td colspan="1" rowspan="1"><p>Writes errors to <code>/wp-content/debug.log</code> instead of showing them to visitors</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>WP_DEBUG_DISPLAY</code></p></td><td colspan="1" rowspan="1"><p>Keeps errors hidden from the front end (set to <code>false</code> for live sites)</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>SCRIPT_DEBUG</code></p></td><td colspan="1" rowspan="1"><p>Forces WordPress to load non-minified JS and CSS files for easier debugging</p></td></tr></tbody></table>

<div data-callout="warning">

Never leave `WP_DEBUG` enabled on a production site for extended periods. It can expose sensitive information and slow down your site. Enable it, reproduce the issue, check the log, then disable it.

</div>

## Reading the Debug Log

1. After enabling debug mode, visit the pages where you experience the issue
2. Open `/wp-content/debug.log` via FTP or file manager
3. Scroll to the bottom - the most recent errors appear last
4. Look for lines that mention `monogram`, `jkd`, or plugin names relevant to the issue

A typical error entry looks like this:

```php
[09-Apr-2026 12:34:56 UTC] PHP Fatal error: Uncaught Error: Call to undefined function...
in /wp-content/themes/monogram/functions.php on line 42
```

The key information is the **error type**, the **file path**, and the **line number**.

## Using SCRIPT\_DEBUG with Monogram

The `SCRIPT_DEBUG` constant is especially useful with Monogram because the theme ships both minified and unminified versions of its assets:

- `assets/js/main.min.js` - production (minified, no console output)
- `assets/js/main.js` - debug (unminified, with source maps)
- `assets/css/main.min.css` - production
- `assets/css/main.css` - debug

When `SCRIPT_DEBUG` is `true`, WordPress loads the unminified versions, making it much easier to trace JavaScript errors to specific source lines.

## Disabling Debug Mode

Once you've gathered the information you need:

1. Open `wp-config.php` again
2. Change `WP_DEBUG` to `false`:

```php
define('WP_DEBUG', false);
```

1. You can leave the other three lines in place - they have no effect when `WP_DEBUG` is `false`
2. Optionally, delete the `/wp-content/debug.log` file to free up space

<div data-callout="tip">

Before contacting [support](https://jkdevstudio.ticksy.com/), enable debug mode and reproduce your issue. Copy the relevant lines from `debug.log` into your support ticket - it helps the team diagnose the problem much faster.

</div>