• Anonymous User 1437452

    (@anonymized-1437452)


    Hi friends

    I have deleted some non-required tags directly from “wp_terms” table using phpMyAdmin.

    Now I think their references are still there in “wp_terms_relationships” and “wp_terms_taxonomy” tables.

    Is it true? If yes, how can I delete their references from other tables so that all 3 tables remain synchronized.

    btw following are the record size of 3 tables:

    wp_terms – 2154
    wp_terms_relationships – 39123
    wp_terms_taxonomy – 2587

    And “wp_posts” table contains 1326 records.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • BACK UP YOUR DATABASE FIRST!!

    Use these two SELECT queries to see what will be deleted:

    SELECT *
    FROM wp_term_taxonomy
    WHERE term_id NOT IN (SELECT term_id FROM wp_terms)
    SELECT *
    FROM wp_term_relationships
    WHERE term_taxonomy_id NOT IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)

    Then, change ‘SELECT *’ to ‘DELETE’ to actually delete the rows.

    Thread Starter Anonymous User 1437452

    (@anonymized-1437452)

    ^^ Thanks a lot mate. It worked and now I have:

    wp_terms – 2156
    wp_terms_relationships – 33851
    wp_terms_taxonomy – 2075

    ==================

    Actually I ran a query to delete unused tags from wp_terms table which deleted 90-90 records from “wp_terms_taxonomy” and “wp_terms” tables.

    I had a backup of “wp_terms” table which I restored but I didnt have any backup of “wp_terms_taxonomy” table. Can you also post a query which will re-create those deleted records in “wp_terms_taxonomy” table which are present in “wp_terms” table.

    Thanks again for your help.

    No way that I know of to match up the wp_term_relationships records and wp_terms records to recreate the wp_term_taxonomy records that link them.

    Thread Starter Anonymous User 1437452

    (@anonymized-1437452)

    ^^ Thats sad but really thanks for your help. If you come to know any way, please let me know. Thanks again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[phpMyAdmin] Manually Deleted Tags from WP_Terms Table’ is closed to new replies.