I am trying to: Add/edit a post which is based on a Toolset CPT
Link to a page where the issue can be seen: You'd need to be in the WP admin
I expected to see: A successful save/publish
Instead, I got: Any change I make to a new post of type Research (a CPT I previously created using Toolset) throws a 403 "Updating failed. The response is not a valid JSON response." error when saved or published.
I don't get the same problem with standard posts, only these CPT posts. If I disable the Toolset Views plugin, the issue goes away.
My site uses Toolset Views and Types, which are both on the latest version.
Many thanks,
Chris
Hi Chris,
Thank you for contacting us and I'd be happy to assist.
An error like this can be caused by a conflict with some code from a third-party plugin or theme.
To troubleshoot this, I'll suggest the following steps:
1. Please make sure that WordPress, active theme, and all (and not just Toolset) plugins are updated to the latest versions.
2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.
If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible conflicting one.
3. In case the issue still persists, I'll need to see how this CPT is set up in the admin area and you're welcome to share temporary admin login details.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Hi Waqar,
I've delved into this issue further and have found the culprit to be Cloudflare's firewall. It's blocking /wp-json/wp/v2 post requests. I've put in a firewall rule to allow this through and sure enough, that works. But I'm not sure how secure that is to just bypass the firewall? Have you encountered this before?
As I mentioned, this only happens for a Toolset CPT and not standard WP posts or pages.
Many thanks,
Chris
Thanks for the update and glad that you were able to narrow it down.
The WordPress REST API requests like the one you mentioned are needed for the proper working of the new Gutenberg/blocks editor.
When using Cloudflare with WordPress it is generally a good idea to exclude its features from the admin area pages:
hidden link
It makes sense to enable optimizations and security features for the visitors on the front-end and not for the administrators working in the admin area.
My issue is resolved now. Thank you!