WordPress.org

Ready to get started?Download WordPress

Forums

Mass delete unused tags & relationships (3 posts)

  1. Blutarsky
    Member
    Posted 5 years ago #

    I have some loads of unused tags and wish to mass delete theme.
    How can you achieve that?
    MySQL query, would be fine.

    I have digged around and found no plugin, and justa a mySQL query sample that hangs the computer!

    Help wanted!

  2. Blutarsky
    Member
    Posted 5 years ago #

    this is the select statment that hangs...

    SELECT * FROM wp_terms wt
    INNER JOIN wp_term_taxonomy wtt ON wt.term_id=wtt.term_id
    INNER JOIN wp_term_relationships wtr ON wtr.term_taxonomy_id=wtt.term_taxonomy_id
    LEFT JOIN wp_posts wp ON wp.ID=wtr.object_id
    WHERE
    taxonomy='post_tag'
    AND ID IS NULL
    AND NOT EXISTS(SELECT * FROM wp_terms wt2
                    INNER JOIN wp_term_taxonomy wtt2 ON wt2.term_id=wtt2.term_id WHERE wtt2.parent=wt.term_id)
    
    ORDER BY name

    Help!

  3. Blutarsky
    Member
    Posted 4 years ago #

    Anyone has the same problem as me?

Topic Closed

This topic has been closed to new replies.

About this Topic