Unexpected token < in JSON at position 0

Hi!

I use Contact Form 7 on my contact page. It worked fine a week ago but now I get this error message when pushing the send (Skicka meddelande) button:

Unexpected token < in JSON at position 0

The message gets sent and I receive it in my Inbox, but the user on the website does not get a confirmation message that his message has been sent. Usually a green box shows with “Thank you for your message!” like expected.

What could be the problem?

Hey @markusp80,

A plugin or customization might be conflicting. Please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Thanks.

Hi!

I searched and looked around a bit and I know that’s your “standard answer” for questions like this and it’s not very helpful. The plugins I have installed I need for the website to function properly.

Could you please try and send a message via the contect form and see what happens?

Hi there,

Please provide the URL to the site you are referring to so that we could test it.

Thank you.

Sorry, I missed to include that in my first post.

It is http://www.markusp.se/kontakt/

I tested the form and there’s a success message. Try clearing your browser cache or try incognito mode.

Regarding my previous answer, yes that is a standard answer because we don’t really know exactly what is causing the issue based on the first information provided. And, Unexpected token < in JSON at position 0 relates to JavaScript so you first need to test for a conflict.

Thanks.

Now it works for me too, both normal mode and incognito.

When I started the ticket this morning I was at work, now I tried from my home network. Could it have something to do with firewalls or something? The reason why I checked it out was because I got 7 messages in my Inbox last night sent from the contact form that were identical yesterday, probably from a visitor on my website that filled in the form and then pressed the button several times because he only saw that unexcpected token message.

Oh well, it works fine now : )

Hi There,

I tried your contact form a couple of times and was not able to encounter the said error. Most of the time inconsistent error like this is related to a caching. Please clear all caching feature/plugin your site might have (I see your site is under CloudFlare).

Also, do you have a browser add-ons in your office (work) PC that is not on your home PC? That is also worth checking.

Thanks,

Hi!

Ok, yes caching is often the problem. I got the messages you sent from John Doe etc. Now I am back at work and tried the contact form from the exact same computer and location, no problems!

I also got an automatic update to Wordpress 4.9.2. All my plugins are up to date as well. So my problem is solved. Thanks!

If you need anything else please let us know.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.