# API04005: JSON Recovery Attempted

## What This Means[​](#what-this-means "Direct link to What This Means")

The server sent a response with some invalid JSON content, but the POS attempted to recover and extract valid data. This is an informational notice rather than a critical error.

## What Happened[​](#what-happened "Direct link to What Happened")

The POS detected:

1. The response contained extra content before or after the JSON
2. The core JSON data was still identifiable
3. Recovery was attempted by extracting the valid JSON portion

## Common Causes[​](#common-causes "Direct link to Common Causes")

* **PHP notices in output** — PHP warnings mixed with JSON
* **Debug output** — Development debugging left enabled
* **Plugin notices** — Other plugins outputting notices
* **Whitespace issues** — Extra whitespace around JSON

## How to Fix[​](#how-to-fix "Direct link to How to Fix")

### 1. Disable PHP Display Errors[​](#1-disable-php-display-errors "Direct link to 1. Disable PHP Display Errors")

In `wp-config.php`:

```
define('WP_DEBUG_DISPLAY', false);

ini_set('display_errors', 0);
```

### 2. Enable Error Logging Instead[​](#2-enable-error-logging-instead "Direct link to 2. Enable Error Logging Instead")

Keep errors logged for debugging:

```
define('WP_DEBUG', true);

define('WP_DEBUG_LOG', true);
```

### 3. Check for Plugin Debug Mode[​](#3-check-for-plugin-debug-mode "Direct link to 3. Check for Plugin Debug Mode")

Some plugins have debug modes that output extra content:

* Review plugin settings
* Disable debug/development modes
* Check for verbose logging options

### 4. Review Recent Changes[​](#4-review-recent-changes "Direct link to 4. Review Recent Changes")

If this started recently:

* What changed on your server?
* Were plugins updated?
* Were PHP settings modified?

## Is This Serious?[​](#is-this-serious "Direct link to Is This Serious?")

While the POS recovered from this issue, it indicates a configuration problem that should be fixed. The recovery process:

* May not always work
* Adds processing overhead
* Could mask other issues

Fix the underlying cause to ensure reliable operation.

## Related Errors[​](#related-errors "Direct link to Related Errors")

* [API04003](/error-codes/API04003.md) — Malformed JSON Response
* [API04001](/error-codes/API04001.md) — Invalid Response Format
