Title: Database Error on Posting&#8211;Duplicate Entry
Last modified: August 18, 2016

---

# Database Error on Posting–Duplicate Entry

 *  Resolved [rchusid](https://wordpress.org/support/users/rchusid/)
 * (@rchusid)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/)
 * When I enter a new post I get messages such as the following (I did edit the 
   path to delete a portion before posting this):
 * WordPress database error: [Duplicate entry ‘5416’ for key 1]
    INSERT INTO wp_post2cat(
   post_id, category_id) VALUES (1748, 3)
 * WordPress database error: [Duplicate entry ‘5416’ for key 1]
    INSERT INTO wp_post2cat(
   post_id, category_id) VALUES (1748, 1)
 * Warning: Cannot modify header information – headers already sent by (output started
   at (Deleted path)/wp-includes/wp-db.php:104) in
    (Deleted path)/wp-includes/pluggable-
   functions.php on line 272
 * If I go to the blog, the post is showing up after this message but new posts 
   are listed as Uncategorized regardless of which categories the post in placed
   in.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [rchusid](https://wordpress.org/support/users/rchusid/)
 * (@rchusid)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586132)
 * Someone fixed this for me by repairing wp_post2cat table
 *  [jhkessel](https://wordpress.org/support/users/jhkessel/)
 * (@jhkessel)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586343)
 * How was this fixed?
 *  [jhkessel](https://wordpress.org/support/users/jhkessel/)
 * (@jhkessel)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586344)
 * after changing hosts, and upgrading wordpress to 2.2.1, i get the following error
   any time i edit a post:
 * WordPress database error: [Duplicate entry ‘0’ for key 1]
    INSERT INTO wp_postmeta(
   post_id,meta_key,meta_value) VALUES (’23’,’_pingme’,’1′)
 * WordPress database error: [Duplicate entry ‘0’ for key 1]
    INSERT INTO wp_postmeta(
   post_id,meta_key,meta_value) VALUES (’23’,’_encloseme’,’1′)
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/blgzorgb/public_html/robotesq/wp-includes/wp-db.php:133) in /home/blgzorgb/
   public_html/robotesq/wp-includes/pluggable.php on line 331
 * please help!
 *  [corrijo](https://wordpress.org/support/users/corrijo/)
 * (@corrijo)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586365)
 * I have the same error, anyone know how to fix this?
 * ———–
    WordPress database error: [Duplicate entry ‘0’ for key 1] INSERT INTO wp_post2cat(
   post_id, category_id) VALUES (’68’, ‘1’)
 * WordPress database error: [Duplicate entry ‘0’ for key 1]
    INSERT INTO wp_postmeta(
   post_id,meta_key,meta_value) VALUES (’68’,’_wp_page_template’,’default’)
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/lemonlan/public_html/wp-includes/wp-db.php:133) in /home/lemonlan/public_html/
   wp-includes/pluggable.php on line 331
 * ———–
 * I’ve done this:
    [http://wordpress.org/support/topic/107994?replies=12](http://wordpress.org/support/topic/107994?replies=12)
 * and this:
    [http://wordpress.org/support/topic/129725?replies=23](http://wordpress.org/support/topic/129725?replies=23)
 * and deactivated all of my plugins.
 * This problem showed up after I moved to a new server.
 * url: lemonland.org
 *  [narcisgarcia](https://wordpress.org/support/users/narcisgarcia/)
 * (@narcisgarcia)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586383)
 * With a WordPress 2.1.2 , an user tried to upload a file.doc and then it appeared
   the same error message (duplicate entry 2500).
 * I have explored the last register in “wp_comments” table, ans I’ve seen in the“
   comment_ID” field a “2499” value.
    Then I edited that value to set it a “2501”
   value.
 * People can now add comments again without problem.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Database Error on Posting–Duplicate Entry’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)
 * [Duplicate Entry](https://wordpress.org/support/topic-tag/duplicate-entry/)
 * [posting error](https://wordpress.org/support/topic-tag/posting-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 4 participants
 * Last reply from: [narcisgarcia](https://wordpress.org/support/users/narcisgarcia/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/database-error-on-posting-duplicate-entry/#post-586383)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
