Skip to main content

This post was split from the topic: 

I am also encountering the same error even with all plugins except Zapier disabled.

WordPress ran into an issue. Error code 500: Could not insert post into the database.

Is the service working at all for anyone?

Hi @tauri, welcome to the Community! 🎉

I’ve moved your post out into a brand new topic here since the error is different to the initial one being discussed in the other topic.  

I did some digging and found other reports of that same error. In those cases our Support team found the following reason for the error mentioned in the error logs:

WordPress database error: Processing the values for the following fields failed: post_content, post_title. The supplied values may be too long or contain invalid data.


I’d recommend checking the selected values for the post’s fields to confirm that they contain the correct values and don’t exceed any maximum character limits that may be in place.

If everything looks ok on that front, can you send over a screenshot showing the current setup of the WordPress action in your Zap? This will allow me to see what fields and settings have been selected so I can confirm that there aren’t any issues with the Zap’s set up that might be causing that “WordPress ran into an issue. Error code 500: Could not insert post into the database” error. Please remove/hide any private information (like names, emails, addresses etc.) from any screenshots before sharing.

Looking forward to hearing from you on this!


Hi SamB,

 

Thank you for moving the post and your detailed reply. It was indeed related to the content being too long. Does this mean that to include the ‘Content Html’ field from Mailchimp, I would need to add another Zap to truncate it first?

Also, which part of the process would be likely to have a maximum character limit?


Happy to help, @tauri! 🤗 

Does this mean that to include the ‘Content Html’ field from Mailchimp, I would need to add another Zap to truncate it first?

You wouldn’t need to create a new Zap, you could just add a Formatter (Text > Truncate) action to the existing Zap to reduce the number of characters.

If you were wanting to split the workflow up into two, two-step Zaps then you might need to send the data from Mailchimp into another app first and handle the truncation there (saying that as Formatter can’t be used as the trigger or last action in a two-step Zap). Potentially something like Google Sheets which has formulas like LEFT that can be used to truncate text fields. Then have a Zap trigger when the new row is added and sent the truncated text over to Wordpress to ensure that the content that’s received wouldn’t exceed it’s limits.

Also, which part of the process would be likely to have a maximum character limit?

It would be one of the WordPress fields you’ve mapped fields to that has a maximum character limit set. The “Content Html” field (guessing that’s coming from Mailchimp’s New Campaign trigger, right?) would include all the HTML code which would count toward the character count. There should be a Content Plain Text field which would get you the text but without the HTML so that would likely help to avoid hitting the character limits. Though, might not be ideal if you’re wanting to keep the HTML formatting of the text.

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have further questions at all do let me know!


Hi @SamB,

 

I have been testing some of your ideas and realised that it wasn’t a character limit that was causing the issue, but an emoji. It seems that the Mailchimp Content Plain Text data preserves emoji, which are for some reason not accepted by the Wordpress App.

I am currently trying to find a way to filter them out.


Thanks for the update @tauri! I’m so glad you were able to identify the underlying cause of that error, great work! 🙌 

Hmm, to remove the emojis you might want to look at using a Code by Zapier step to handle that. Not sure how familiar you are with coding but Code steps have a Code with AI feature that you could use to help generate the necessary code for your. You can learn more about that here: Generate a Code step using AI (Beta)

If you run into any further trouble on this do let us know, happy to help further! 🙂


Reply