1

Is there a way to delete specific tags from the db? I have one tag that does not seem to work. I have used the following code to see all tags used from a specific section, knowing I have entries using a tag called Logos

{% set test = craft.entries.section('projects').limit(null) %}
<ul>
    {% for tag in craft.tags.relatedTo(test) %}
        <li>{{ tag.title }}</li>
    {% endfor %}
</ul>

This outputs a list of all tags used in the section called projects, Logos is not listed.

I have a sidebar that outputs each tag a single entry was assigned. Logos is output when viewing an entry that was tagged with Logos. Clicking on the Logos link loads a page that should list all entries that use Logos etc but for this specific tag it doesn't find any entries. I have a feeling this tag is corrupt somehow in the db as this was working fine a while back.

I noticed someone had duplicated this tag... if I start typing Logos in the Add a tag when editing an entry I see four results Logo, Logo, logos, Logos.

Neither logos, or Logos returns entries. And only one of the Logo returns entries.

I then decided to add all of those Logo, Logo, logos, Logos. And renamed the three that didn't work to blank. This then causes the tag to display as "Tag 686" etc. Clicking the tag then loads all of the entries using that tag. So for some reason it just doesn't seem to like the tag being named Logos...

Anyone have any ideas on what could be going on here?

  • 1
    I'm not sure how to answer your question, but you should check out Bob Olde Hampsink's Tag Manager plugin, which will add a CP section for tags to Craft (much like the one built in for categories). Among other things, Tag Manager lets you delete tags easily. – Mats Mikkel Rummelhoff Oct 20 '15 at 18:21
  • Thanks, installed that. It works to delete so I deleted the Logos tag, and then re added it. Added the tag Logos to an entry. Then viewed that entry and clicked on Logos tag, same thing doesn't show entries using the tag Logos. If I change it to Logoss, or any other tag name it works. Something odd about that tag name. – Bowenac Oct 21 '15 at 0:06
  • If I remove the name Logos from the tag and save it empty. It then becomes Tag 742, then it obviously displays as Tag 742 but then if I click it, it works and shows the other entries using that tag. Very strange behavior going on here haha. – Bowenac Oct 21 '15 at 0:11
2

So this seems like a bug to me. I found the issue, and it was caused by another tag group having the same tag name. Here is an example

We have three tag groups.

  1. Default
  2. Industry Tags
  3. Services Tags

Logos was a tag in Default, and also Services Tag group. Once I removed or renamed the tag named Logos from the Default Tag Group. I was then able to find entries using the tag named Logos from a section where entries used the Services Tag Group. This section has a tag field called Services which the source is Services Tags.

I just found another tag called Brand that does not work in the Services Tag Group because Industry Tag Group has the same Brand tag. If I rename the tag named Brand from Industry, then the entries are found in the section that uses the Services Tag Group for the tag named Brand.

Is this normal behavior as it doesn't seem like it to me. Easy solution would be to just not use tag groups but that would be a lot of refactoring tags for all entries.

  • Did you already report this to P&T? – carlcs Oct 22 '15 at 7:41
  • I sent them an email this morning about it. Curious if anyone can repro this. – Bowenac Oct 22 '15 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.