Can’t save new post with WordPress 3.0

After upgrading WordPress to 3.0 and then to 3.0.1 I couldn’t save newly created posts anymore.

Creating new users didn’t work either.

Turns out there is a problem with the DB tables. For some reason some of the fields don’t have default values and if you try to save something, the save SQL operation fails.

You can easy check if you have the same issue:

Just add define(‘WP_DEBUG’, true); to your wp-config.php file and then you should see the error messages.

To fix it, just run this query:

ALTER TABLE wp_posts CHANGE COLUMN post_mime_type post_mime_type VARCHAR(100) NOT NULL DEFAULT ”;

Same for creating a new user. This is the error message:

WordPress database error: [Field ‘user_activation_key’ doesn’t have a default value]

INSERT INTO `wp_users` (`user_pass`,`user_email`,`user_url`,`user_nicename`,
`display_name`,`user_registered`,`user_login`) VALUES (‘$P$BdvJNscOoULkBECWck8tL0′,’’,
‘2010-09-10 15:08:08′,’Natasa’)

And this is the solution:

ALTER TABLE wp_users CHANGE COLUMN user_activation_key user_activation_key VARCHAR(60) NOT NULL DEFAULT ”;

Maybe there are other places where something similar is missing. I’m sure you can fix it in the same way.

Ähnliche Beiträge

Leave a Reply

Your email address will not be published. Required fields are marked *