Back to Community

Troubleshooting the 'ParserError 200' and 'Unexpected token' JSON Error in Force Regenerate Thumbnails

16 threads Sep 10, 2025 PluginForce regenerate thumbnails

Content

If you're using the Force Regenerate Thumbnails plugin and see a wall of errors in your browser's console mentioning 'ParserError 200' and 'Unexpected token', you're not alone. This common error can halt the regeneration process and leave you with incomplete results. This guide will explain why this happens and walk you through the most effective solutions.

What Causes the 'ParserError 200'?

This error is not a bug in the plugin's core functionality. Instead, it's a symptom of a communication breakdown. The plugin uses AJAX (Asynchronous JavaScript and XML) to process your images in batches. It sends a request to the server and expects a clean, valid JSON response back to continue.

The 'ParserError 200' occurs when the server's response is corrupted. The plugin's JavaScript expects pure JSON but receives something else, causing it to fail with an 'Unexpected token' error. The HTTP status code 200 means the server completed the request, but the content of that response is invalid.

The most common source of this corruption is unexpected output from your server during the PHP processing. This output is prepended or appended to the JSON response, breaking its validity. This extra output typically comes from:

  • PHP Warnings or Notices: Even minor PHP errors, if displayed, can corrupt the JSON.
  • White Space in Files: Extra whitespace or characters in a plugin or theme's PHP files (often in the closing ?> tag) can be sent to the browser.
  • Other Plugins or Caching: A conflicting plugin might inject its own output, or a server-level caching mechanism might serve a corrupted response.

How to Fix the 'ParserError 200' JSON Error

Follow these troubleshooting steps to identify and resolve the source of the corrupted output.

Step 1: Enable Debugging to Find the Source

The first and most crucial step is to find out what the extra output is. You can do this by enabling WordPress debugging, which will make PHP errors visible. It's recommended to do this on a staging site first. If that's not possible, enable it on your live site but only for a short period while you troubleshoot.

  1. Connect to your website using FTP or your hosting provider's file manager.
  2. Locate and edit the wp-config.php file in your site's root directory.
  3. Find the line that says define('WP_DEBUG', false);.
  4. Replace it with the following lines:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors', 0);


    This configuration enables debugging, logs errors to a file (wp-content/debug.log), and prevents errors from being displayed on your site, which could further corrupt the JSON.
  5. Save the file and upload it back to your server.
  6. Now, open your browser's developer tools (F12 on most browsers) and go to the 'Console' tab.
  7. Run the Force Regenerate Thumbnails process again. When the error occurs, check the 'Network' tab in your developer tools. Click on the failed AJAX request (it will likely be a 'admin-ajax.php' request) and look at the 'Response' preview. The corrupted output may now be visible here, revealing the PHP warning or notice causing the problem.
  8. Also, check the wp-content/debug.log file on your server for a list of all recent PHP errors.

Step 2: Fix the Identified Errors

Once you've identified the specific PHP errors from the debug log or network response, you can address them. Common fixes include:

  • Updating the plugin or theme mentioned in the error message.
  • Fixing incorrect file permissions on your server (your host can help with this).
  • Temporarily disabling a plugin that is throwing constant warnings.

Step 3: Perform a Conflict Test

If enabling debug logging doesn't reveal a clear culprit, a plugin or theme conflict is likely.

  1. Switch your theme temporarily to a default WordPress theme like Twenty Twenty-Four.
  2. Deactivate all plugins except for Force Regenerate Thumbnails.
  3. Run the regeneration process again. If it works without error, you've confirmed a conflict exists.
  4. Reactivate your plugins one-by-one, testing after each one, until the error returns. The last plugin you activated is the source of the conflict.
  5. You can then choose to leave that plugin disabled, look for an alternative, or contact its developers for support.
  6. Finally, reactivate your original theme to test it. If the error returns only after switching back, your theme is the likely cause.

Step 4: Check for the imagick Extension (For PDFs)

As seen in the sample threads, a specific error—'The imagick extension is required for PDF files'—can also cause failures. If you are processing PDFs, ensure the PHP imagick extension is installed on your server. You may need to contact your web hosting provider to have this enabled.

Conclusion

The 'ParserError 200' is a frustrating but solvable issue. It is almost always caused by external factors on your server—PHP errors or plugin conflicts—that corrupt the data the plugin relies on. By methodically enabling debug logging and performing a conflict test, you can pinpoint the exact cause and get the Force Regenerate Thumbnails plugin working smoothly again.