Support » Plugin: WordPress MU Sitewide Tags Pages » Sitewide tags creating duplicate categories in tags blog

  • Resolved mbeasi

    (@mbeasi)


    This is an issue that’s been happening for me ever since I started using Sitewide Tags with WordPress 3.0, and I’ve just dealt with it all this time. Since I’ve never seen anyone else complain about this, I suspect it could be something I’ve done wrong, but here’s the issue:

    When posts are made in blogs other than the site’s main blog, frequently (but not *always*) they are generating duplicate categories in the main blog. For instance, if someone posts an entry with the category “License Requests,” the post is added to the tally of all those using the original “License Requests” category, but it also creates a new category with the same name. This happens over and over, not with all categories, but with specific ones repeatedly. If I don’t delete them on a weekly basis, I eventually end up with several pages worth of the same category in my list of categories on the main site. Again, this only seems to happen with certain categories, and it happens with those every time. Others seem entirely unaffected.

    It’s not a fatal issue, which is why I’ve never brought it up before, but it is a bit of a pain to maintain. Has anyone heard of this happening before? Any clue as to what’s gone wrong?

Viewing 15 replies - 1 through 15 (of 67 total)
  • I am also having this issue, and it seems that it has generated enough categories to noticeably slow down the post management pages in my tags blog.

    Some of our categories are in there 400 times. Since these all get pulled into select elements and other parts of the post management pages, these pages are so large that my browser is nearly crashing on each page load. The HTML source is over 26,000 lines long!

    So, I used this query to count how many times each category has been added:

    SELECT name, COUNT(term_id)
    FROM wp_1_terms
    GROUP BY name
    ORDER BY COUNT(term_id) DESC;

    Thankfully, it is creating these categories but not actually using them. So this query should tell me the number of categories that aren’t being used (in my case, this is currently 8007):

    SELECT COUNT(t.term_id)
    FROM wp_1_term_taxonomy t
    	LEFT OUTER JOIN wp_1_term_relationships r ON r.term_taxonomy_id = t.term_taxonomy_id
    WHERE t.taxonomy = 'category'
    	AND r.object_id IS NULL;

    This query should delete all of the categories that aren’t being used:

    DELETE t
    FROM wp_1_term_taxonomy t
    	LEFT OUTER JOIN wp_1_term_relationships r ON r.term_taxonomy_id = t.term_taxonomy_id
    WHERE t.taxonomy = 'category'
    	AND r.object_id IS NULL;

    That cleared things up a lot for me. I hope this helps!

    Plugin Author Ron Rennick

    (@wpmuguru)

    That category issue has been fixed in the dev version. It was inserting the categories without checking to see if the post status was publish.

    Hi,

    I am having this same issue. I deleted over 3000 categories last night. I also have a grand total of 20,000 tags now listed that I have not gotten to to delete yet. As jlencion stated above it has gotten to the point of slowing down the entire network of sites.

    Ron? Are you saying the 3.1.3 version has this issue fixed?

    If not is there another solution out there? Or do we just need to keep spending hours deleting the extras?

    Thanks for any help.

    Plugin Author Ron Rennick

    (@wpmuguru)

    Ron? Are you saying the 3.1.3 version has this issue fixed?

    The latest version has this fixed. You will still have to delete the extra ones. I found that issue on one of our networks and spent 5-10 minutes a day for a week or so deleting the extra tags/categories.

    If your site is an upgraded MU install, the extra terms will also be in the sitecategories table.

    Hi Ron,

    Thanks for the help.

    My site is an upgraded MU site. I had no idea they’d be in there, but now I can go get rid of them.

    Gene

    Ron,

    I’ve installed the new version of sitewide tags, but am not seeing the categories or tags transfer to my main site. All else works, except for the tags and categories.

    Any advice? Thanks, very much, in advance.

    Plugin Author Ron Rennick

    (@wpmuguru)

    but am not seeing the categories or tags transfer to my main site

    Do you mean the new posts that are arriving in the tags blog have no categories & tags associated but they do in the originating site?

    Thanks for the prompt response.

    That’s correct.

    Plugin Author Ron Rennick

    (@wpmuguru)

    Can you create a new thread for this since it’s unrelated to the original topic of the thread?

    Lots of people will find this thread based on the title and use it as a resource to address the issue in their network. Changing to a completely different topic/issue mid way through the thread makes the thread confusing.

    Hi, Me Again!

    What exactly SHOULD be in the Sitecategories database table? Just the 300 actual categories I have sitewide? Or should there be more than that in there? I ask cause I am about to clean it out and it has 15000 total entries. Many with the aforementioned tag, tag2, tag3 numbers after them and such. Just wondering if I can just scan for my actual categories and delete the rest.

    Thanks

    Plugin Author Ron Rennick

    (@wpmuguru)

    The tags also go in there because they are terms. The sitecategories table name is from the days before tags and was never renamed.

    But you will have lots that you will be able to clean out.

    Thanks Ron,

    Yep, I knew there’d be a lot to clean out. Gonna use your little bit at a time strategy rather than sit here for 2 days doing nothing but deleting.

    Hi!

    jlencion, Where do i put this code?

    @notreco: It is SQL, so you would probably want to use some sort of MySQL frontend, like MySQL Workbench, SQLyog, or phpMyAdmin.

Viewing 15 replies - 1 through 15 (of 67 total)
  • The topic ‘Sitewide tags creating duplicate categories in tags blog’ is closed to new replies.