• Skip to main content
  • Skip to primary sidebar
  • Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / wordpress tutorials for beginners advanced complete guide to run WordPress / could not insert term into the database. wordpress

could not insert term into the database. wordpress

go into operations and set the number for auto-increment to be higher than your highest term_id (click on term_id until the highest numbers are at the top (0 being the lowest), you’ll have the number).

You should try ALTER TABLE wp_terms AUTO_INCREMENT = 1 then. Please note that it will set auto increment to 1, which means that you will need to re-enter every term you have in that table or any other term and taxonomy related tables. It will probably break the connections. Safest way would be to delete all the terms and taxonomies from admin area and then run this code in SQL from phpMyAdmin. Repeat this code with every table related to taxonomies and terms (just change the table name in code)

Problem 1:  wp_terms, wp_termmeta and wp_term_taxonomy all had their ID’s set not to AUTO_INCREMENT.

Solution: ALTER TABLE table_name AUTO_INCREMENT = increment_number

  • This sets AUTO_INCREMENT manually to a selected number
  • increment_number value must be at least one number higher than your current highest number of that table’s primary key that is auto incremeted
  • Also, don’t forget to change table_name

Other way would be to use the same code: ALTER TABLE wp_terms AUTO_INCREMENT = X but take the highest ID in wp_terms table, add 1 to it (e.g highest ID is 83, add 1 to it and you get 84) replace the X with that value (84 in our example). Do not forget to backup your database if data is important!

wp_terms, wp_termmeta and wp_term_taxonomy all had their ID’s set not to AUTO_INCREMENT.

 

Table of Contents

Toggle
  • wp_terms AUTO_INCREMENT not set
    • Nothing changed
  • Manually by php my admin table structure
    • object cache eabled
    • Maually add tags in wordpress phpmyadmin worked
    • Table: wp_terms
    • Table: wp_term_taxonomy
    • wp_termmeta columns
    • Table: wp_termmeta
    • wp_term_relationships
    • tags

wp_terms AUTO_INCREMENT not set

their ID’s set not to AUTO_INCREMENT.

my case 541

 

ALTER TABLE 2xpwp_terms AUTO_INCREMENT = 543;

ALTER TABLE 2xpwp_termmeta AUTO_INCREMENT = 1419;

ALTER TABLE 2xpwp_term_taxonomy AUTO_INCREMENT = 542;

 

ALTER TABLE 2xpwp_term_taxonomy AUTO_INCREMENT = 542;

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0107 seconds.)
ALTER TABLE 2xpwp_terms AUTO_INCREMENT = 542;

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0428 seconds.)
ALTER TABLE 2xpwp_termmeta AUTO_INCREMENT = 1419;

Nothing changed

wp_terms, wp_termmeta and wp_term_taxonomy all had their ID’s set not to AUTO_INCREMENT

Manually by php my admin table structure

1.backup 3 tables wp_terms, wp_termmeta and wp_term_taxonomy 

2.  click on table structure of you notice extra with no “Auto increment”  click on change

3. and tick the A_I auto increment as show in below image.

 

ALTER TABLE wp_terms AUTO_INCREMENT = 1

Set auto incrment in wp terms wordpress phpmy admin

ALTER TABLE `2xpwp_terms` CHANGE `term_id` `term_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;

Query error:
#1062 – ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry ‘542’ for key ‘PRIMARY’

#1062 – ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry ‘541’ for key ‘PRIMARY’

object cache eabled

cleanup  SELECT * FROM `wp_term_relationships`     not did anthinhg

Orphaned relationships

Maually add tags in wordpress phpmyadmin worked

insert in php my admin nit relecting tags or cats

INSERT INTO `2xpwp_terms` (`term_id`, `name`, `slug`, `term_group`) VALUES (‘542’, ‘faculty jobs’, ‘faculty’, ‘0’)

 

wp terms table columns

term_id`, `name`, `slug`, `term_group

 

wp_term_taxonomy colums

  • term_taxonomy_id: A unique ID for the term and taxonomy pair
  • term_id: The ID of a term in the wp_terms table
  • taxonomy: The taxonomy in which the term resides
  • description
  • Parent
  • count

INSERT INTO `2xpwp_term_taxonomy` (`term_taxonomy_id`, `term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES (‘542’, ‘542’, ‘post_tag’, ”, ‘0’, ‘0’);

 

Now tag got inserted & reflected in wordpress dashboard.

Table: wp_terms

Field Type Null Key Default Extra
term_id bigint(20) unsigned PRI auto_increment
name varchar(200) IND
slug varchar(200) MUL
term_group bigint(10) 0

 

 

Table: wp_term_taxonomy

Field Type Null Key Default Extra
term_taxonomy_id bigint(20) unsigned PRI auto_increment
term_id bigint(20) unsigned UNI Pt1 0
taxonomy varchar(32) UNI Pt2 & IND
description longtext
parent bigint(20) unsigned 0
count bigint(20) 0

wp_termmeta columns

Table: wp_termmeta

Field Type Null Key Default Extra
meta_id bigint(20) unsigned PRI auto_increment
term_id bigint(20) unsigned IND 0
meta_key varchar(255) YES IND NULL
meta_value longtext YES NULL

 

ALTER TABLE 2xpwp_termmeta AUTO_INCREMENT = 1419;

wp_term_relationships

post_id value = object_id

Field Type Null Key Default Extra
object_id bigint(20) unsigned PRI Pt1 0
term_taxonomy_id bigint(20) unsigned PRI Pt2 & IND 0
term_order int(11) 0

 

ALTER TABLE wp_termmeta MODIFY COLUMN meta_id bigint(20) unsigned NOT NULL auto_increment;
ALTER TABLE wp_terms MODIFY COLUMN term_id bigint(20) unsigned NOT NULL auto_increment;
ALTER TABLE wp_term_taxonomy MODIFY COLUMN term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment;

1062 – ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry ‘542’ for key ‘PRIMARY’

 

Manually add catoegires in to dataabse

INSERT INTO `2xpwp_terms` (`term_id`, `name`, `slug`, `term_group`) VALUES (‘556’, ‘admit card exam date updates’, ‘admit-card’, ‘0’);

INSERT INTO `2xpwp_term_taxonomy` (`term_taxonomy_id`, `term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES (‘552’, ‘552’, ‘category‘, ”, ‘0’, ‘0’);

tags

 

INSERT INTO `2xpwp_term_taxonomy` (`term_taxonomy_id`, `term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES (‘556’, ‘556’, ‘post_tag‘, ”, ‘0’, ‘0’);

Primary Sidebar

wordpress tutorials for beginners advanced complete guide to run WordPress

  • wordpress speed optimization Speed up wordpress Score on Google pagespeed
  • best wordpress plugins social, seo, Backup, speed up your blog
  • TOP 10 Wordpress Themes Premium/ Free & providers
  • Wordpress Adsense Plugins & Manually
  • Social share buttons for website Wordpress Blogger
  • How to bulk delete in wordpress posts, pages, Media Images, tags and categories
  • TOP 5 Best wordpress comment plugins 2020 (disable pingback, replytocom, customize form)
  • all in one seo pack vs yoast seo pressor
  • Auto post to Facebook, twitter, Google Plus Wordpress Posts 2019
  • wordpress plugins that slow down your site and its alternatives
  • How to use wordpress tags and categories
  • Wordpress duplicate thin content Issues {FIXED}
  • how to increase wordpress memory & file upload size
  • combine rss feeds wordpress
  • Reduce the impact of third-party code ,optimize JS delivery, Minify, remove unused js, pre connect, inline, lazy load etc
  • change wordpress site url internal links in mysql command phpmyadmin
  • install wordpress on ubuntu nginx lemp command line apache debian
  • Wordpress Security Plugins 2021 (Brute force, Login lockdown, Malware scanner etc)
  • website cache best caching plugins wordpress w3tc cloudflare
  • How to add adsense amp ads to wordpress
  • wordpress password reset in 3 ways mail, phpmyadmin, mysql command
  • how i recovered hacked website site 5 times ft wordpress?
  • wordpress redirection examples Rankmath seo
  • enable browser caching in wordpress apache nginx caching headers explained
  • W3TC w3 total cache plugin setup guide review comparison with wp rocket and wp super cache
  • Wordpress database optimization (don't neglect) plugins & phpmyadmin manually
  • Optimize css delivery inline critical css, remove unused css, render blocking css
  • Converting WordPress into static website speed after 1 second dynamic 3 seconds
  • Wordpress errors and fix
  • Rules to get 100/100 in Google pagespeed web core vitalsscore
  • Install xamp & wordpress on localhost windows
  • favicon ico Change / Add / Disable favicon in wordpress Ft Genesis Theme or any theme
  • increase wordpress memory limit (how to ) 40MB , 64 MB 128 MB or 512 MB maybe 1024MB
  • wp cron job check working or not disable enable change schedule
  • google analytics plugins for wordpress #sitekit #monsterinsights gadwp back as gainwp
  • Lazy Load Adsense to improve core web vitals - Vs revenue
  • xmlrpc php wordpress uses, disable without 403 error log message
  • wordpress 304 header implement using plugin
  • wordpress change post date programmatically (auto on update like blogger
  • sorry you are not allowed to access this page. admin WordPress options table
  • clone wordpress in linux ubuntu server lemp nginx
  • Cloudflare cache rules for WordPress along with page rules cache level everything
  • wordfence-waf.php fatal error fixed after migration
  • Cloudflare page rules cache level everything redirect and sub domain
  • wordpress delete all posts from database mysql query for phpmyadmin
  • php fpm oom killer problem how to dig it.. memory pool and execution time
  • nginx wordpress multisite subdirectory multiple domains
  • Helpful Content update recovery Trying to dig it
  • How to Move a Single WordPress Site into a Multisite
  • Enable multisite in wordpress in 3 steps problems datbase error
  • Seprate single site from wordpress multisite domain based
  • Error establishing a database connection wordpress multisite
  • Add single wordpress to MultiSite wordpress
  • genesis theme cateogory customization examples
  • could not insert term into the database. wordpress
  • wordpress breadcrumbs not showing full path
  • There has been a critical error on this website fed up
  • Site structure WP categories vs sub pages or multisite posts or pages
  • WordPress pyramid structure Permalinks Category vs sub pages vs multisite

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy