The response is not a valid JSON response – Windows IIS
If you’re I presume you’ve already tried some other techniques to fix the “The response is not a valid JSON response” issue with WordPress running on Windows Server and IIS.
In my case, I am running PHP 8.1.8 and the issue was easy to fix.
For me, the error happened while trying to save content to a Widget.
In the log files I noticed the OPTIONS verb being used and a 405 error.
The fix is simple. Go to HANDLER MAPPINGS, double click your PHP mapping.
Click REQUEST RESTRICTIONS.
do one or the other. Add the word OPTIONS to the current list, OR just click ALL VERBS.
Your “The response is not a valid JSON response” should now go away.
NOTE: On IIS WordPress setups, you need to make sure you have a HOSTS file mapping for your website to the local IP address for the website (NOT PUBLIC IP, local machine IP). This is necessary for the various CRON jobs to work.