While doing routine troubleshooting I noticed an error appearing multiple times in the server log (a truncated version is replicated below).
WordPress database error Unknown column 'actioned_text' in 'field list' for query SELECT ... FROM wc_admin_note_actions WHERE ...
Messages in the server log are not necessarily problematic but when the same one is logged multiple times that’s probably a sign to start investigating.
The website in question was running WordPress with the ever-famous WooCommerce, a plugin that turns your website into an online store. We set up a development environment, copied the website over, disabled all plugins and reverted to a default WordPress theme but the error persisted. So we looked a little deeper.
The problem: missing columns in the WooCommerce database table
The error message points to the
wc_admin_note_actions database table, added by the WooCommerce plugin, and the
actioned_text column inside. Taking a look with phpMyAdmin we saw that the column in question is not in the table.
To confirm our findings, we set up a fresh WordPress website and installed WooCommerce. We then took a look at the
wc_admin_note_actions table and to no one’s surprise there was the
actioned_text column (along with 2 other columns,
The solution: add the missing columns to the
That’s what we did and it worked like a charm: no more error messages.
Caveats (because of course there are)
- Make a back-up of the database before you start messing with it.
- If you’re not comfortable changing your database structure, get someone to do it for you.
- WooCommerce also adds data into this table on first install. Because the restored fields will obviously have no data in them, I do not know how this will affect things. As of WooCommerce 5.4.1 however, these fields contain NULL data so I do not foresee any issues.
But why did the columns go missing?
I honestly have no idea. The website has been up and running since 2016 and we’ve never had to migrate or restore the database. My only conclusion is that the WooCommerce update process must have flubbed up at some point in time and skipped over inserting these columns. Searching online shows that while this problem isn’t widespread it does happen (even to different columns and different database tables).