Weighted Words

This plugin creates a weighted list of commonly-used words in your blog posts. Works for WordPress versions 1.5 and up. Licensed under the GPL.

Current version: 1.1 - download it here!

Instructions

  1. Upload weighted_words.php to your plugin directory.
  2. Activate the plugin.
  3. Edit your template file(s). Place the following function where you want the list to appear:

    weighted_words($mincount, $minlength, $minfont, $maxfont)

    $mincount: Minimum number of times a word must have been used before appearing in the list, default is 25
    $minlength: Minimum word length, default is 3
    $minfont: Minimum font size (%), default is 50
    $maxfont: Maximum font size (%), default is 250

    The output is enclosed by <p class=”weightedwordlist”></p>.

  4. Optional Configuration Steps

  5. If you have pretty permalinks enabled, and you want to use a prettier search URL, look in weighted_words.php for these lines:

    // Edit this string to change your search URL.
    echo ‘/index.php?s=’ . $word . ‘&submit=ww’;

    Change to:
    echo ‘/search/’ . $word ;
  6. Change the list of “noise” words that will not be counted. Look in weighted_words.php for these lines:

    // Remove words that don’t matter–”stop words.”
    // Edit this list as needed.
    $overusedwords = array( ‘’, ‘a’, ‘am’, …

    and add or remove list entries as needed.

Frequently Asked Questions

Does Weighted Words work with multiple-author blogs?

When used on a multiple-author blog, Weighted Words will count words in posts from all authors. There is currently no way to count posts from a specified author only.

Help! My umlauts are garbled!

The good news is, you’re not alone. Although Weighted Words seems to work fine for accented characters in Italian, it explodes on umlauts and Ås; this problem has been reported by several German and Swedish users. The bad news is, I have no idea how to fix it. Sorry.

I added the code, but nothing shows up!

First, view the HTML source of your page: Does <p class=”weightedwordlist”> appear? If it does, try decreasing the value of $mincount. You may not have written enough to have used any words more than 25 times.

If you can’t help me, who can?

There’s a Weighted Words thread in the WordPress support forums with some handy advice.