Stupidly, I truncated my posts table with out thinking about the term relationships. Now I have a bunch of 404s because there are broken term relationships. Is is possible to rebuild the table with the correct pairings?
Leave a Reply
You must be logged in to post a comment.
If your
AUTO_INCREMENT
value wasn’t reset and your new posts will still have uniqueID
s and you can do:to see which term relationships are orphans and use a
DELETE FROM
to fix it.warning: Truncating your wp_term_relationships deletes everything in that table! if you want to only delete tag term relationships then make sure you use the correct sql.
After truncating the wp_term_relationships table I used a custom script to re-tag my posts. You can do something similar like this:
pretty simple.