Meta Keyword Generator

Ever found your self sitting and trying to decide which meta keywords to put on your site. waste no more time on it! let the meta keyword generator do the boring job for you! Max was messing around with a plugin created by ludovic at http://lbcd78.fr that generated keywords based on the current pages title and content. I like the idea, it is easy to understand, quick to install and works like a charm. except his plugin was in his native tongue, french. Max had found an exclusion word list on the net, words that should be ignored, but it did still create alot of errors.

After looking through the code I decided to start from scratch using the old script as a base to work on and after a few hours I came up with this little nifty script.

  1. Copy the sourcecode into a new file called mkg.php
  2. Activate the plugin, go to Options > Meta Keyword Generator and tweak it to fit your requirements
  3. Insert the following line of code in your templates header file, proberly called header.php

<meta name="keywords" content="<?php mkg(); ?>" />

I have created a highlighted version of the source instead of updating and maintaining a zip archive. It can now be found right here

11 Responses to “Meta Keyword Generator”

  1. Ludovic says:

    Very good job, thanks for this upgrade

  2. Glad that you like it :)

  3. Max Thrane says:

    I’ve just updated to the latest version :) But you might want to edit the post from time to time to let the others know if there were some changes/bugfixes etc ;)

  4. I will, is currently working on a project that auto zips and sends the source when needed. :)

  5. Max Thrane says:

    I was forced to disable the plugin as it simply kills my site… As long as someone tries to search, the site hangs and then it dies… Sharing hosting for the win… :/ Dang… It could use some optimizing! ;)

  6. I’m using the same host as you Max, so i don’t think thats the problem… it is most likely another plugin , which is causing it to work slowly or something like that, the debug ablities on these hosts are some what limited.

    I am looking into hooking the keyword generation into the save the post/page commands, but i haven’t quite found the right way of doing it yet. I will of course keep looking and give an update when I find the solution

  7. Max Thrane says:

    Sounds nice :)

    Also I don’t think that it’s MKG’s fault alone… But I use lots of other plugins and they make a great load on the site, and right in this case MKG was just over the top… Too bad :|

  8. Robert says:

    Does this plugin work in WP 2.2? I keep getting an error… httpdocs/wp-content/plugins/mkg.php:272

    Yes, I disabled the French version first.

    What is the correct code to put in the header as you give two different versions? One with an echo and one without.

    Thanks

  9. Hey Robert,

    I have just updated the description of the plugin had changed it, but had forgotten to update the plugin describtion.

    and yes the plugin works in WP 2.2, I am currently working on a plugin that inserts this code automatically and saves single post meta data in the database so it only calculates the info on pages with multiple posts (like the frontpage). another thing you might want to check is that the mkg function dont mess your search page up, did so on maxt.dk’s page.

  10. ShOkTy says:

    nice plugin Lars, but it seams that omitted the = , after content

Leave a Reply