Add Keywords
Note: Upgrade to Version .3. See below.
Joomla! provides a great system for including metadata keywords on articles; when editing an article there is a spot on the right hand side of the page to edit the keywords (it’s under “Metadata Information”). This information is used to provide the <meta> tags for the page and to connect pages using the standard Related Articles module that comes with Joomla!
But what if you don’t want to have to think up and type in keywords every time? Wouldn’t it be nice if the related articles plugin could just always work on the full text of the articles? That’s what this plugin solves. More below.
Originally Written by Daniel Beck
To give credit where it is due, I am not the original author of this plugin. It was written by my friend Daniel Beck; the most I did for that version was provide a few ideas for its implementation. At version .2 I rewrote some of the code to implement it more efficiently. Thanks also goes to John Bekker at www.sjlcreations.be for contributing the code for several features.
Current Version: .3
Version .3 of the add keywords plugin is available from http://joomlacode.org/gf/project/addkeywords/frs/. This version adds the ability to regenerate keywords for all articles in the database. Simply set the option to “Yes,” save an article once, and set it back to “No.” All articles in the database (unless in an excluded section or category) will now have keywords.
There is also a feature request and bug tracker system at http://joomlacode.org/gf/project/addkeywords/tracker/.
Usage:
Whenever you create or save an article, this plugin automatically fills in the keywords for you. It does this by:
- Parsing all the words in the article and ordering them by number of times used
- Removes the most common words in the English language from the list by comparing it against a blacklist
- Adds the top twenty words into the keywords section
One thing to note: any words you add to the keyword section will be overwritten when you save. At the moment you either do keywords yourself or use this plugin, not both.
Installation:
- Install the plugin
- Go to your Plugin Manager and enable the plugin
- That’s it, you’re done!
Features
- Exclude categories or sections
- Include author name or alias as a keyword
- Limit keywords by length or number
- Automatically generate keywords for all articles in the database
I am unable to access the joomlacode.org area to download your extension. I have an account but am denied access to this particular area.
Thanks Frank
Download links not working… the login page apear
same issue happened to me
Duly fixed, my apologies.
thx admin for your help
test start
Would be really nice if you made a component that could batch create all the keywords in the articles.
@Jeff: A worthy request. Very useful indeed for those who already have numerous articles. I will add it to the feature requests in the tracker and get around to it some day; unfortunately I’m a bit swamped at the moment.
Good idea..but now only for people who use english.
It’s a good idea do add open field to add/edit yours words (black list). Another …add only 3,4,5,6 or 7 Keywords. Thant will be great!
Very nice but it definitely needs the ability to edit the black list. If you have {tabs} or other similar inclusions, they automatically used.
One other feature I have found extremely useful is a parameter to specify which sections and or categories to exclude. This would support the batch processing of multiple files (in support of the component feature suggested on sourceforge). – Ian
All good ideas and some (ability to edit blacklist) already on the feature request list. I can only implement things so fast, however, so I’ll get around to them eventually. If anyone else wants to take a stab at some of them, let me know.
Nice plugin! One thing that would ice the cake is to fill in the robots and author. :-)
seriously cool plug. Thanks.
joomla 1.0 :) ?
great idea , should be part of the core , why would not want too add keywords,
I’ve installed and enabled plugin.
Unfortunatelly it don’t do anything.
I use PHP 5/A[ache 2.x
Nice plugin but its just grabbing keywords from before the read more line.
I just installed the extension and it works. But the problem I’m having is that the articles have to be saved twice in order for the keywords area to be populated. I’ve double-checked numerous times and it doesn’t populate on the 1st save. Any ideas?
tservers
To DmitryGrinberg-Lyandres,
Try saving the article again and see if it populates. That’s the issue I’m having but it does populate after the 2nd save.
tservers
I found the trick that works….. when creating your article FIRST hit the “Apply” button, THEN hit the save button, or you can just hit “Apply” button 2 times and the keywords will populate before you save the article when you look at the meta keywords section.
tservers
@Alek: I noted that the other day. Will hopefully post a fix soon.
@tservers: That’s funny, it shouldn’t have to be done twice. The plugin modifies the data before it gets posted to the database, so I’m not sure what’s up. I have to fix some other bugs in it, so I’ll try to look into that.
Hi great plug but problem. After keywords are inserted and I try to edit some of them out or add a few of my own it does not allow me to save the keyword changes. Also the word “This” gets included into keywords though it’s on the blacklist. Any ideas on why I can’t edit keywords after they get inserted? Permission prob?
Again awesome plugin, I was just thinking of this the other day and here you have it!
@David: See up above under usage. You either use this plugin to generate keywords or you do it yourself. Every time the article is saved the keywords are re-generated so your custom ones will always be removed. You can, with version .2, exclude a specific section or category.
Thanks for this plugin … but this Ä, Ö, Ü letter is a big problem. Can you help?
@Samantha: I don’t think this is something the plugin can fix. It just works on the text that is passed to it. My version seems to work fine with these characters, and even with other alphabets entirely. Perhaps it is your version of PHP or the web browser?
Hi James thanks for your response and duh on me for missing your usage info.
Options on editing to add and or subtract keywords when working with individual articles would be great. For instance plugin leaves out some important words and or includes unnecessary words and it would be nice to edit. This plugin is great though!
It would be great if you also had an administration module in the same vein as the ‘Missing Metadata’ module so that I could tick the articles to apply the generate keywords alorithm on once (I.e. Not every time I save the article). It’s just that for my site, the plugin, while a great little tool for some sites, will just be a little too much of a blunt instrument for others that need more fine-tuning and selective application of keywords, irrespective of section and category.
James – Great little tool – just love it!
Suggested simple enhancement to solve these listed issues – when the process is triggered on the Save event, the current keywords field is tested for content and if length is zero, then tags are generated. If someone edits the article and wants to regenerate tags, they just delete all content from the field. Otherwise once tags are generated, the user can modify/edit as they wish and not lose their work.
Thank you so much for this worthy plugin. Now I finally get some useful results…
One other thing. Could it be possible, when someone handfills the keyword text area. That 50 most used keywords used in other articles show up (via ajax or pull-down or whatever)
Thanx again!
Marquito
@Duke: I think if it allows for custom keywords it will have to be in some other means. Part of the usefulness of the plugin is that it will automatically update if the page is updated. Requiring the clearing of the box in order to update defeats that simplicity.
@Marquito: Not easily possible. The plugin grabs the onsave event and modifies the post data. It would be much more difficult to edit the actual keywords entry form. I’ll leave that for someone else to write.
Made a little change to the code, as I always would like to get the meta-description also filled and more important, if I have already written soemthing by myself into the meta-tag or meta-description field, this schould be kept and not overwritten:
// return the modified metadata for posting
// $metadata = JRequest::getVar(”meta”);
// $metadata['keywords'] = $keywords;
// JRequest::setVar(”meta”, $metadata);
$metadata = JRequest::getVar(”meta”);
if(strlen($metadata['keywords']) < 80)
$metadata['keywords'] = $metadata['keywords']. ($metadata['keywords']==TRUE ? ‘, ‘ : ”) .$keywords;
if(strlen($metadata['description']) < 250)
$metadata['description'] = $metadata['description']. ‘ ‘ .substr(trim($fullText), 0, 250);
JRequest::setVar(”meta”, $metadata);
Maybe this will help somebody
regards
Zappu
@MTW (Zappu): Interesting. The problem is that if your custom metadata is longer than 80 char, then it doesn’t get the auto-generated words added. And if the custom keywords plus the auto ones are less than 80 char, then the next time around they get duplicated.
Hi,
The plugin should select keywords only from the article title, because keywords that are in article lead but not in the title, those are just words.
Danny
Awhile back I dug up a list of 2,000 common English words for a black list. I’ve tried it using this plugin and it seems to work well. You are welcome to use it too.
I also updated the charater removal code on line 112 to get rid of some extra characters that were showing up.
$text = preg_replace(’/[\.|\'|\"|\`|\,|\(|\)|\-|\!|\#|\@|\$|\?|\%|\&|\_|\;|\:]/’, ‘ ‘, $text);
[List of (2000) words removed by blog owner.]
Does this work when articles are saved from the front end. It works great for me when logged in as admin, but not for users on front end.
Hi!
This is a great plugin, however, it should NOT distinguish uppercase letters from lowercase letters.
For example, “Joomla” and “joomla” is the same word, but your pluging consider two words and will use both on the meta tag.
Everything else is just great! Thank you!
Thank you for “add keyword”
Thank you for “add keyword” it is so usefull
@IceBurn: Good point. I’ve added it to the todo list.
James, Great extension. Works great except for the following small problem (v.2).
Add Keywords will generate the first twelve keywords and then a bunch of empty lines and then the remaining 8 keywords. The final 8 keywords include words on the blacklist, which is how I noticed the problem initially. The meta keywords only shows the first 12, the last 8 keywords only show on the article with the extension “alpha toolbar” with tags enabled.
Any ideas?
The description does exactly what I needed and the “Generate All” worked perfect.
But when I edit an article and save it, no keyword is added to the meta keywords.
The article is with keywords longer than the minimum and the keywords are not on the blacklist. The exclude field is empty.
What else can be the reason?
Klaus
A must have, I think, thanks a lot.
In v.3 I noticed Add Keywords “joins” last word and first word of two different paragraphs.
Maybe it’s a problem expecially for languages different than eng but sometimes I think that to add a whitelist of preferred keywords, if they exist in text, could help to determinate best working keywords.
It could be very useful, also, a component it extracts and exports in text format all keywords and to start from that point optimizing Add Keywords.
Great work, thanks again.
This IS the best meta keyword generator that I have found.
I have a suggestion that additional “weight” or prominence be given to the tags.
And a request to allow user to include the section and category automatically in the keywords, just as you can chose to add the author.
If anyone can advise me how to add the article section and category to my addkeywords.php code I’d appreciate it.
Thank you.
My original comment included a bracketed “h” , but it was stripped out when I submitted it. (I wasn’t trying to spam)
The sentence does not really make sense without a h tag or the word heading-
“I have a suggestion that additional “weight” or prominence be given to the “heading” tags.”
Thanks
“Add Keywords” is a great plug in!
I have inserted, for download, in my web site a file called “blacklist_ita_en_add keywords.txt”.
This file contains the blacklist with Italian and English terms for your plug in. If you are interested could you insert this file in you plug in directly.
Hello,
Does anyone know where I can find this blacklist in French please ?
I tried to do one but even with 438 words I’m not getting rid of all of them ! My script needs to be perfect since Im displaying the keywords in the articles with a link on them for a search tool.
thank you !
Vincent
great plugin!
can you create version for joomla 1.x, please?
Nope, sorry bd. The only one I’ve got is for Joomla 1.5. If you want to work on a 1.0 version, I’ll be glad to post it here for you, though I’d suggest you migrate to 1.5–there are a lot of nice new features.