10

Is there an easy way to migrate or copy existing meta keywords for articles so that they become article tags, in Joomla 3.6?

The situation is: Joomla, until a few versions ago, didn't have a tag system. Before that, we used the meta keywords instead, and modules like "Related articles" also used the meta keywords to identify related articles. Now, the current version of the related articles module uses the tags instead of the meta keywords, which essentially means it can't process any of the older articles. Also it's more beautiful/correct to use tags instead of meta keywords.

So I would like some automatic way to process a few hundred articles, read the existing meta keywords and import them as tags.

I had a look at the database structure to see if some SQL scripting can do that, but the tag system uses relational fields and while I could probably write a script it would take a fair amount of fiddling and testing.

I'd think more people have this issue and somebody might have developed a plugin or a command line script, but I can't find anything helpful.

1 Answer 1

4

We have developed a script that does that and that can be found here. Essentially, we loop through articles and then we grab the keywords, add them as tags, and then tag the articles. We have mainly used the JHelperTags class in order to do that. The script should run on any system - but please expect some performance issues on your website if you have thousands of tags (this is not caused by the script, but it is an issue in Joomla's tag functionality). Tags are heavy (in any CMS) and should be used with care.

2
  • 1
    Wow, super! I'll try it in the next few days (when I have read the script, made backups etc. - not that I doubt you, but good practice...).
    – uUnwY
    Commented Dec 11, 2016 at 20:35
  • Further comment: The script didn't quite do everything, it doesn't seem to update the table ucm_content correctly, which means the "similar articles" and "popular tag" modules don't work correctly. However, I found a fix for that. After running your script, I created a temporary tag (eg. "000") and then used the batch processing in the article list to add this tag to all articles. Afterwards I could delete this tag again.
    – uUnwY
    Commented Dec 12, 2016 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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