• After various experiments I want to remove all but the default category and reset the incremental numbering (so that a new category will be 2) – so I can’t just delete them from within WP.

    As no posts are assigned to these categories, I’m wondering if I can simply delete the unwanted categories from the wp_terms table, and then reset the numbering with: ‘ALTER TABLE wp_posts AUTO_INCREMENT=2;’?

    Or, alternately, to delete the unwanteds from within WP and then run the above SQL code?

    I realise this is trivial and obsessive behavior – although I can happily live without such a fix, part of my reason for asking is to learn more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello gulliver!

    First of all, make backup from your database. After, open your “wp_term_taxonomy” table, and delete all categories except:
    – nav_menu
    – link_category
    – category (“term_id” and “term_taxonomy_id” whit value “1”)

    Thread Starter gulliver

    (@gulliver)

    Thanks.
    I’m sorry for my slow response… don’t seem to have received a notification.
    Tomorrow I’ll dive into the database and apply your suggestion.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Edit SQL to remove categories and reset numbering’ is closed to new replies.