Column count doesn't match value count at row 1 Column count doesn't match value count at row 1 wordpress wordpress

Column count doesn't match value count at row 1


The error means that you are providing not as much data as the table wp_posts does contain columns. And now the DB engine does not know in which columns to put your data.

To overcome this you must provide the names of the columns you want to fill. Example:

insert into wp_posts (column_name1, column_name2)values (1, 3)

Look up the table definition and see which columns you want to fill.

And insert means you are inserting a new record. You are not modifying an existing one. Use update for that.


  1. you missed the comma between two values or column name
  2. you put extra values or an extra column name


You should also look at new triggers.

MySQL doesn't show the table name in the error, so you're really left in a lurch. Here's a working example:

use test;create table blah (id int primary key AUTO_INCREMENT, data varchar(100));create table audit_blah (audit_id int primary key AUTO_INCREMENT, action enum('INSERT','UPDATE','DELETE'), id int, data varchar(100) null);insert into audit_blah(action, id, data) values ('INSERT', 1, 'a');select * from blah;select * from audit_blah;truncate table audit_blah;delimiter ///* I've commented out "id" below, so the insert fails with an ambiguous error: */create trigger ai_blah after insert on blah for each row begin   insert into audit_blah (action, /*id,*/ data) values ('INSERT', /*NEW.id,*/ NEW.data);end;///* This insert is valid, but you'll get an exception from the trigger: */insert into blah (data) values ('data1');