1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 When are unused tags deleted?

Discussion in 'XenForo Questions and Support' started by jeffwidman, Nov 10, 2015.

  1. jeffwidman

    jeffwidman Active Member

    I thought tags were auto-removed when no longer used, but I've got some tags that have usage '0'. Are they cleaned up by a cron job or should they be automatically removed as soon as they're no longer used?

    Would an addon like MediaGallery or Vaultwiki potentially interfere with this? Both integrate with the XF tags system.

    Will tags with usage '0' still get listed in the Sitemap?

    Mostly they're tags that were used by spammers, so some of the terms are quite spammy--definitely not something I want to be telling Google to come checkout.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Are you sure the tags are not being used on any threads, even soft deleted ones?
  3. jeffwidman

    jeffwidman Active Member

    I'm not...

    Would soft-deleted cause the ACP to report tag usage at 0 but still prevent them from being deleted?

    Regardless, would also like to know if they're deleted immediately or by cron once they are truly unused.
  4. Chris D

    Chris D XenForo Developer Staff Member

    No, they are explicitly excluded from the Sitemap.

    The use_count reflects the number of times the tag is used in content which is visible.

    If you soft delete a thread, it will decrease the use_count, but the tag itself will not be removed from the xf_tag_content table, it will just have the visible field set to 0 (on the basis that soft deletion could be temporary, or accidental).

    If you hard delete a thread, it will decrease the use_count but it will also remove the entry in the xf_tag_content table. Ultimately, when the usage is calculated, if a tag has no records in the xf_tag_content table then the tag will be deleted completely (immediately).

    So, in summary, if the tag still exists, and it has a use_count of 0, it should be attached to content that is no longer visible and this tag will be excluded from the sitemap.
    ForestForTrees, empire and jeffwidman like this.
  5. jeffwidman

    jeffwidman Active Member

    Thanks for the detailed answers Chris, much appreciated!

Share This Page