|
/ Documentation /Troubleshooting/ How to Fix “Unexpected Token” Errors in SureForms

How to Fix “Unexpected Token” Errors in SureForms

This guide explains why a SureForms submission may show the error “Unexpected token ‘<‘,” and how to identify the server issue causing it. The error normally means that the form expected a JSON response, but the server returned an HTML error page instead.

What to do first

Run a plugin conflict test. If the form starts working with only SureForms active, re-enable plugins one at a time to identify the conflict.

What the error means

SureForms sends the form data to your WordPress site through the REST API. It expects the server to return a JSON response. When WordPress encounters a fatal or critical error, it can return an HTML error page instead. Because HTML begins with “<”, the browser reports the message “Unexpected token ‘<‘,”.

Confirm the server response

You can confirm this through your browser developer tools:

  • Open the page containing the form and submit it again.
  • Right-click the page and select Inspect, then open the Network tab.
  • Select the submit-form request and open the Preview or Response tab.
  • If the response shows a WordPress critical error page rather than JSON, continue with the checks below.

Common causes

  • Plugin conflict: Another plugin may trigger a PHP fatal error when the SureForms REST API request runs.
  • PHP version incompatibility: Your site may be using a PHP version that does not support the syntax required by SureForms or another active plugin.
  • Theme or custom code conflict: Custom functions, a child theme, or a code-snippets plugin can also run during the REST API request and cause a critical error.

Step 1: Run a plugin conflict test

Please temporarily deactivate all plugins except SureForms. If your form uses a payment gateway or another essential SureForms extension, keep only the components required for this test active.

  • Go to Plugins > Installed Plugins in your WordPress dashboard.
  • Temporarily deactivate every plugin except SureForms.
  • Clear any page, server, or CDN cache.
  • Open the form in a private or incognito browser window and submit a test entry.
Important

Only perform this test when it is safe for your site. If the site is live, use a staging site or a maintenance window where possible.

Step 2: Identify the conflicting plugin

If the error disappears with only SureForms active, a plugin conflict is confirmed.

  • Reactivate one plugin at a time.
  • After each activation, submit the form again.
  • When the error returns, note the last plugin you activated. This is likely the conflicting plugin.
  • Share the plugin name, version, and any error details with SureForms support.

Step 3: Check your PHP version

If the error continues with only SureForms active, check the PHP version configured by your hosting provider. Update to a currently supported PHP version for your WordPress installation, then retest the form. If you are unsure which version to use, ask your host to check the WordPress and plugin requirements before making a change.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top