Title: Duplicate Tags
Last modified: August 19, 2016

---

# Duplicate Tags

 *  [deanhamilton11](https://wordpress.org/support/users/deanhamilton11/)
 * (@deanhamilton11)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/duplicate-tags/)
 * So i recently imported content from a tumblr blog to wordpress using this tool:
   [http://benapps.net/](http://benapps.net/). However there seems to be a problem
   with duplicate tags. For example:
    I have 39 posts tagged “beagle” with a slug
   of “beagle”. I have 120 posts tagged “beagles” with a slug of “beagles-1” or “
   beagles-2” Everything tagged as “beagles” registers as its own tag. This is a
   huge problem for me. Is this some sort of wordpress import problem? I cant even
   change the slugs manually, i just get an “Item not updated.” error. Is there 
   any way i can group these tags? has anyone experienced something similar?
 * please help.

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/duplicate-tags/#post-1754485)
 * IT IS EASY TO MESS THIS UP! Backup your database first!!
 * You can reassign the posts from beagles-1 and beagles-2 to beagles with some 
   SQL queries. Assume that the term_taxonomy_id for beagles is 40, beagles-1 is
   4, and your database prefix is wp_. Use this query to reassign the posts to 40:
 *     ```
       UPDATE IGNORE wp_term_relationships
       SET term_taxonomy_id = 40
       WHERE term_taxonomy_id = 4
       ```
   
 * Note that this will not update any posts that are in both beagles and beagles-
   1. Repeat the query using the term_taxonomy_id for beagles-2 instead of 4.
 * Now, update the post counts for beagles with this:
 *     ```
       UPDATE wp_term_taxonomy
       SET count =
       (SELECT count(p.ID)
       FROM wp_posts p, wp_term_relationships tr
       WHERE p.ID = tr.object_id
       AND tr.term_taxonomy_id = 40
       AND p.post_type = 'post'
       AND p.post_status = 'publish')
       WHERE term_taxonomy_id = 40
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Duplicate Tags’ is closed to new replies.

## Tags

 * [duplicate](https://wordpress.org/support/topic-tag/duplicate/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/duplicate-tags/#post-1754485)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
