get_tags() not doing as expected

Hi all,

I tried to echo the number of tags on my site to my Browse Collections page by calling the get_tags() function in collections/browse.php. The number displayed was 879, but there are far more tags on my site than that (into the thousands). Has anybody encountered a similar problem?


Oops!! Apologies!

I mean that I tried calling the total_tags() function NOT get_tags()!!

..Have just checked that this was not the problem, but I am definitely calling total_tags()!

How many tags does Omeka say you have on your admin tags page (admin/tags)?

Hmmm according to the admin/tags page (apologies, didn't think of checking that one!) it seems that I do indeed have 875 tags (+4 on an exhibit)! What was confusing me is that that the omeka_tags table in my omeka database has 1,331 rows. But perhaps the table does not relate to the tags the way I think it does?

Thanks a million,

Hi Dee,

This can happen if you've deleted some items, and there are tags in the Tags table that are no longer associated with items. When you delete items, it doesn't actually delete tags (though it does delete the relationship between the tag and the item). This is why you would see more rows in your tags table than show up when doing a total_tags() check.

If you want to delete any tags, you can do that in the administrative panel under the "Tags" tab.

Hope this helps,


Thanks for the response! Wow I was wondering if that was what was happening! Tags are left in the omeka db after they are deleted.. so you have to have to manually delete any old tags from the omeka-tags table to get rid of them! Good to know...