WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Sitewide Tags Pages
[resolved] Sitewide tags creating duplicate categories in tags blog (68 posts)

  1. mbeasi
    Member
    Posted 3 years ago #

    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?

  2. jlencion
    Member
    Posted 3 years ago #

    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!

  3. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    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.

  4. worldblogosphere
    Member
    Posted 3 years ago #

    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.

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    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.

  6. worldblogosphere
    Member
    Posted 3 years ago #

    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

  7. bradshap
    Member
    Posted 3 years ago #

    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.

  8. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    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?

  9. bradshap
    Member
    Posted 3 years ago #

    Thanks for the prompt response.

    That's correct.

  10. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    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.

  11. bradshap
    Member
    Posted 3 years ago #

  12. worldblogosphere
    Member
    Posted 3 years ago #

    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

  13. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    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.

  14. worldblogosphere
    Member
    Posted 3 years ago #

    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.

  15. notreco
    Member
    Posted 2 years ago #

    Hi!

    jlencion, Where do i put this code?

  16. jlencion
    Member
    Posted 2 years ago #

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

  17. notreco
    Member
    Posted 2 years ago #

    @jlencion .. oh.. So I have to do this everytime i want to clear out the categories..

    There is no way of making this a permanent filter in the sitewide-tags.php ? Each time it copies a post to the main site it check with this filter..

    Thanks for fast answer!

  18. jlencion
    Member
    Posted 2 years ago #

    You probably could do that if you wanted to. I'm not sure exactly what you would need to do to accomplish that though.

  19. notreco
    Member
    Posted 2 years ago #

    @ jlencion .. Oki! Big thanks anyway!

    Is there anyone else in here that has a solutions for this? Coded into the plugin it self.. Or through functions.php

    Thanks!

  20. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    @notreco - install the latest version of SWT and then delete the empty categories in the tags blog admin.

  21. mbeasi
    Member
    Posted 2 years ago #

    Since people are talking about this again... Ron, I installed the development version when we were originally talking in this post, and I'm sorry to say that it didn't fix the problem at Manga Bookshelf at all. I still have to go in weekly and delete duplicate categories, or they quickly multiply into the hundreds.

    Will the newest version of the official version work where the dev version doesn't?

  22. notreco
    Member
    Posted 2 years ago #

    @mbeasi @mbeasi .. I installed the latest version (0.4.1.1) yesterday and deleted all old categories .. The categories keeps on duplicating! :(

    I'm using WordPress 3.1

  23. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I'll put it on my list to look into.

  24. notreco
    Member
    Posted 2 years ago #

    @Ron Rennick Huge thanks to you!

  25. notreco
    Member
    Posted 2 years ago #

    @Ron .. Can I maybe donate a sum to speed up the process? :)

  26. notreco
    Member
    Posted 2 years ago #

    Is there a quick fix for this? Plugin that prevents wordpress plugins from creating categories.. of make sitewide tags put all posts in the same category.. etc etc

  27. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    @notreco - for some reason neither of your last two posts showed up in my RSS feed. That's why I hadn't responded to them.

    For everyone - try the development version to see if it fixes the duplicate category issue - http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/download/

  28. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    @Ron .. Can I maybe donate a sum to speed up the process? :)

    I work full time and SWT is one plugin out of about 30 that fall into my spare time. A week turn-around is about the best you are going to see from me unless something creates a critical issue for users.

  29. notreco
    Member
    Posted 2 years ago #

    @Ron .. Hi, I just tried the development version. It still duplicates categories.

  30. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    @notreco - may I see the site & a post in the tags blog that has one of the categories being duplicated?

    The patch that I added just before posting the above runs a query to check if there is an existing category with the same slug/description & only adds it when one is not found.

    However, if the slug was different when SWT receives, then SWT would proceed with creating the new category. I wonder if there is something else in common about the installs that are having the issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic