BLOG

Keyword Generator

20th of January 2007
Tags:

Right, I have just updated the Keyword Generator WordPress Plugin. It’s vastly improved and is now at version 0.2

Here is what has been done

Better Stop Words list
Removes duplicated keywords and commas
Only picks words of a certain length

The download link at the bottom of this page is for the current version.

Please note: make sure you edit the default words list!

January 14, 2007

I have just created a WordPress plugin that basically scans a WordPress Blog and finds all of the keywords. It then places the keywords in the title tag. It could also be used in the meta tags. I believe title tags greatly increase search engine ranking.
Feel free to download it:

Download

To use it make sure you add this to your header file: <?php voodoochilli_seo(); ?> This should be placed just after <?php wp_title(); ?>


23 responses to “Keyword Generator”

  1. Voodoochilli says:

    I should point out that this is a very early version of this plugin. I will keep improving it as time goes on.

  2. davef says:

    Voodoochilli- you may also be interested in the “SEO Title Tag” plugin. it takes a slightly different approach to optimizing the tags, but it has a lot of neat features which may give you some ideas as you continue developing your plugin.

    http://www.netconcepts.com/seo-title-tag-plugin/

  3. Voodoochilli says:

    Cheers Dave, I will do that!

  4. […] Keyword Generator will scan your pages and find keywords that are used a lot on that particular page. It will then place them in the title tag. You can easily modify to place in your meta data as well. (No Ratings Yet)  Loading … […]

  5. J. Burkhart says:

    Your plug-in worked like a charm in behaving precisely as you stated it would.

    Problem was the selection of keywords which were found all across the top of my blog title heading.

    had had had had had had had had had had had!

    It was funny at the time of discovery!

    But I couldn’t figure out nor find anyway to change it.

    HELP?

  6. Voodoochilli says:

    Hi J.

    Yes if you look in the code file, you will see a filter list (its an array)

    It has words like ” and ” , ” the ” , ” that ”

    simply add ” had ” to the list

    Cheers

    Harry

  7. Voodoochilli says:

    also make sure ” had ” has spaces either side of it.

  8. J. Burkhart says:

    Thank you very much!
    Now at least I won’t feel as if I have been “had”! LOL 🙂

    Sorry…. It’s an American slang expression….

    Be well and take care.*

  9. Voodoochilli says:

    Its a British expression too. 🙂

  10. J. Burkhart says:

    Since having already added a variety of new words to be filtered I am concerned that upgrading to your newer version may require me once more fine tuning my entire blog!

    Which would be a nightmare.

  11. Voodoochilli says:

    ahh! I made a point of adding your words to the filter, at least the “had” anyway!

  12. Voodoochilli says:

    Maybe on the next version I will store the bad words list in a seperate text file. That would mean there would be no upgrade issues.

  13. Peter says:

    Hey, great plugin.

    One problem though: when the post title is scrapped and inserted after the site description, there is no space between the two. Check out my site and see what i mean: http://www.advercation.com

    Any idea how to fix this?

  14. Voodoochilli says:

    hmm, it doesnt do that on mine. It should be a simple case of putting:

    echo ” “;
    as a line somewhere. I will have to see if I can replicate the problem on my site, or find a page that is having the same problem. It might be a theme specific issue. Also, what version of wordpress are you using?

  15. danny says:

    thanks m8 il try this on my new blog

  16. A couple of tiny changes to the keyword generator.

    Lots of stop words (never_str), which will not appear in output.

    List of words, which appear in output if they appear 1+ times in content (always_str).

    Static words, which will appear in all output(static_str).

    Except for the stop words, you’ll want to tailor the other lists for your individual blog.

    I only spent a couple minutes with this, it works, no time to clean it up or document at the moment – sorry. When I have time, I’ll add something to the WP framework to allow editing the lists from the WP control panel, and finish it up.

    The hanging comma is not an issue, ie: not worth a line of code to remedy until I have time to get back to this…

    Here’s how I call it in theme’s header:
    —————————–
    ‘ . “\n”;
    echo ” . “\n”;
    } else {
    echo ” . “\n”;
    echo ” . “\n”;
    } ?>

    —————————–
    Here’s what it spits out (from an actual post):
    —————————–

    —————————–

    <?php voodoochilli_seo(); ?> This should be placed just after <?php wp_title(); ?> You can also place this in your keywords meta tag
    Author: Harry O’Connor
    Version: 0.21
    Author URI: http://blog.voodoochilli.com
    */

    function voodoochilli_seo($my_title = ”, $my_article = ”) {
    // the accuracy of the keywords, the default is 3 meaning it will only find words that show up at least 3 times
    $accuracy = 2;
    //min word length
    $length=2;
    $maxlength= 2500;
    $keywords = ”; // suppress IDE warning

    if(!$my_article) {
    $default_words= $wp_query->post->post_title;
    } else {
    $default_words = $my_title;
    }

    // staticwords = always appear in output (not always a great idea for SEO)
    $static_str = “news daily top”;

    // alwayswords = always appear in output if they appear at least once
    $always_str = ” crazed cop police illegal cop cops officer officers lawyer law enforcement swat pig agent attorney “;
    $always_str .= ” unconstitutional rights botched raid certified uncertified trained training untrained quit quits resign “;
    $always_str .= ” resigns fire fired suspend suspended chief lietenant major captain “;
    $always_str .= ” Alabama Alaska Arizona Arkansas California Colorado Connecticut District Columbia Delaware Florida Georgia Hawaii Idaho Illinois “;
    $always_str .= ” Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada “;
    $always_str .= ” New Hampshire Jersey Mexico York North Carolina Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina Dakota Tennessee “;
    $always_str .= ” Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming United Kingdom Virgin Islands Australia Canada Australian Canadian “;
    $always_str .= “”;

    // basewords = give extra weight to these words in output
    $basewords = ” correctional corrections bad “;
    $basewords .= ” deputy sheriff investigator judge prosecutor attorney “;
    $basewords .= ” attorneys lawyer lawyers arrested charged charges indicted indictment warrant warrants “;
    $basewords .= ” suspended suspends domestic shooting shoot shot shootings shots killed kills “;
    $basewords .= ” dead lying purjury beating beaten lawsuit claim suit faces jury trial “;

    // these words will not appear in output
    $never_str = ” a about above across act after afterwards again against all almost alone along already also although always am among amongst amoungst “;
    $never_str .= ” amount an and another any anyhow anyone anything anyway anywhere are around as at back be became because become becomes becoming “;
    $never_str .= ” been before beforehand behind being below beside besides between beyond bill both bottom but by call can cannot cant can’t co computer “;
    $never_str .= ” con could couldnt couldn’t cry cut de describe detail do done down due during each eg eight either eleven else elsewhere empty enough “;
    $never_str .= ” etc even ever every everyone everything everywhere except few fifteen fify fill find five for formerly forty found four from front “;
    $never_str .= ” full further get give go had has hasnt hasn’t have he hence her here hereafter hereby herein hereupon hers herself him himself his “;
    $never_str .= ” how however hundred i ie if in inc indeed interest into is it its itself keep last latter latterly least less ltd made many may me “;
    $never_str .= ” meanwhile might mill mine more moreover most mostly move much must my myself name namely neither never nevertheless next nine no “;
    $never_str .= ” nobody none noone nor not nothing now nowhere of off often on once one only onto or other others otherwise our ours ourselves out “;
    $never_str .= ” over own part per perhaps please put rather re same see seem seemed seeming seems serious several she should show side since sincere “;
    $never_str .= ” six sixty so some somehow someone something sometime sometimes somewhere still such system take ten than that the their them themselves “;
    $never_str .= ” then thence there thereafter thereby therefore therein thereupon these they thick thin third this those though three through throughout “;
    $never_str .= ” thru thus to together too top toward towards twelve twenty two un under until up upon us use very via was we well were what whatever when “;
    $never_str .= ” whence whenever where whereafter whereas whereby wherein whereupon wherever whether which while whither who whoever whole whom whose “;
    $never_str .= ” why will with within without would yet you your yours yourself yourselves “;
    $never_str .= ” 1 2 3 4 5 6 7 8 9 0 she her him but – i a the while were could said then asked about says an are as at be by com for “;
    $never_str .= ” from when would will told after with what while how have of and said here they it to the or you in took take “;
    $never_str .= ” is your site blog them their all who one has this so will on that am out other no was way two three “;
    $never_str .= ” four five six seven eight nine ten up his did not we had have good day these try ill get man led set “;
    $never_str .= ” again also any been can happen line may maybe men met over since some than there those want which “;

    $remove_special = array(‘_’,’=’.’+’,'”‘,”‘”,’.’,’,’,’“’,’”’,’&’,’|’,’!’,’@’,’#’,’$’,’%’,’^’,’*’,'(‘,’)’,'[‘,’]’,'{‘,’}’,”,’/’,’/’,’?’,”);

    global $wp_query;

    $post_title = $wp_query->post->post_title;

    if (!$my_article) {
    $post_content = $wp_query->post->post_content . ” ” . $wp_query->post->post_title . ” ” . $basewords;
    } else {
    $post_content = $my_title . ” ” . $my_article . ” ” . $basewords . $static_str;
    }

    $post_content = str_replace($remove_special, ” “, $post_content); // clean up strings
    $never_str = str_replace($remove_special, ” “, $never_str);
    $always_str = str_replace($remove_special, ” “, $always_str);
    $static_str = str_replace($remove_special, ” “, $static_str);

    $post_content = strtolower ($post_content); // prepare strings
    $always_str = strtolower ($always_str);
    $static_str = strtolower ($static_str);
    $never_str = strtolower ($never_str);

    $post_content =strip_tags($post_content);
    //$post_link = get_permalink($wp_query->post->ID);
    // echo $post_title. ” “;

    $never_words = (explode(” “, $never_str)); // make strings arrays
    $always_words = (explode(” “, $always_str));
    $static_words = (explode(” “, $static_str));

    //splt the words up
    $split_words = (explode(” “, $post_content));//split up the words

    //for ($i=0; $i$accuracy && strlen (trim($split_words[$i]))>$length ) || (in_array($split_words[$i],$always_words) || (in_array($split_words[$i],$static_words)))){
    if(!in_array(trim($split_words[$i]),$never_words)) {
    $keywords .= trim($split_words[$i]) . “, “;
    }
    }
    }
    }

    //split the words again so we can grab just unique words and sort the array
    $split_words = explode(“, “, $keywords);
    $split_words = array_unique($split_words); //remove duplicates
    $never_words = array_unique($never_words);
    sort($split_words); // sort found words
    $keywords= “”;//null the keywords variable
    for ($i=0; $i $length) {
    $keywords .= trim($split_words[$i]) . “, “;//re fill the keywords
    }
    }

    echo str_stop($keywords,$maxlength);

    if (strlen($keywords) $max_length){
    $string = substr($string, 0, $max_length);
    $pos = strrpos($string, ” “);
    if($pos === false) {
    return substr($string, 0, $max_length).”…”;
    }
    return substr($string, 0, $pos).””;
    }else{
    return $string;
    }
    }

    // if debugging in an IDE, create these two variables with test content, otherwise this call is never executed
    if (($z123article) && ($z123title)) {
    voodoochilli_seo($z123title,$z123article);
    }
    ?>

  17. Wow, that didn’t go so well…

    Download zip with original message and nuvuduseo.php here:

    http://www.badcopnews.com/documents/nuvuduseo.zip

  18. Voodoochilli says:

    Cheers, I will have a good look at that later.

  19. SEO | Likoma says:

    […] I tried out this plugin, Dynamic Keyword Generator. […]

  20. […] Automatic keywords generator This little plugin will scan your pages and find keywords that are used a lot on that particular page. It will then place them in the title tag. You can easily modify to place in your meta data as well. […]

  21. […] Automatic keywords generator This little plugin will scan your pages and find keywords that are used a lot on that particular page. It will then place them in the title tag. You can easily modify to place in your meta data as well. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

  • About Us

    We are Voodoochilli Design Ltd - the place to go for Hereford web design

    We have been designing and building websites for over 10 years and have worked with a wide range of businesses from start-ups to multi-billion pound internationals and everything in between.

    If you are interested in finding out more, check out our full website.

  • Recent Posts