I have been unable to update or publish a post in WordPress for the last couple of months! Every time I tried I got the message, “Update failed” or “Publish failed”.
I couldn’t figure it out. I’m using WordPress 5.1.1, and I upgraded to the latest PHP, but I still could not publish. No other errors. Nothing to go on. I tried setting WP_DEBUG and WP_DEBUG_LOG to true in my wp-config.php file. Nothing. No debug.log was generated and I saw no debug messages in my web browser, and worse yet, I had no answer as to why I could not publish or update posts.
Well, I noticed after almost giving up, that when I logged out of /wp-admin I was sitting on a /wp-login.php page that was insecure (I saw the http: protocol in my brower’s address bar.) Well I wasn’t gonna have that. I don’t want to accidentally log into my wordpress site insecurely, so I figured out how to force SSL for all admin pages. I set FORCE_SSL_ADMIN to true in my wp-config.php file, and would you believe it, I tried to log in using the http protocol, and it sent me to https, and after I signed in, I was able to finally update and publish a post! That was it!
I haven’t seen any articles describing this solution to this issue, so I’m posting it here for now.
Hope this helps someone else.
Cheers!