Wordspinner – Free Word Spinner Plugin for WordPress

I got a couple of emails about my last article about the free spinner code, and have made a rather spiffy plugin for WordPress that will do the same thing on any posts or pages on the site.

You can grab it here: http://wordpress.org/extend/plugins/wordspinner/

[[There’s, There is]] an example of what [[it, WordSpinner, Word Spinner]] does in this [[very,]] page. Hit refresh on your browser and see if you can [[tell,pick it]]!

See the included readme file for changelog and useage (it’s easy as pie).

UPDATE: 24th June 2010: BUG & PERFORMANCE FIX. Also, please now post questions at http://www.kythin.com/wordspinner2/

UPDATE 21st June 2010: Multiple Spinner support finally released!

UPDATE 26th Aug 2009: Just upgraded it to be compatible with 2.8.6

45 thoughts on “Wordspinner – Free Word Spinner Plugin for WordPress

  1. To have the spinner work for Text Widgets you need to manually edit line 611 of wp-includes/widgets.php so that instead of “echo $text;” it says “echo run_spinner($text);”

    I just did that and now I can cycle affiliate ads that only take a text-widget to add or change. Woo!

  2. I really like your plugin, but have most of my content in custom fields, would it be hard to make it work with custom fields?

    • If it’s in custom fields, you’re probably calling them in the template somewhere, right? Use the same kind of logic as in the comment about text widgets and replace the bit in your template that outputs the custom field data with a function call to “run_spinner($whatever-the-variable-is-to-output-your-data)”. Does that make sense?

      e.g. to output a spun version of all the custom fields, use this in your template:

      echo run_spinner(the_meta());

  3. yes got it working a treat, the only problem I had it would not spin with the seperator as a tilda? I had a older plugin that wont work with the new version of wordpress, I’ve just imported all those older stories into my new blog.

    Any quick way of changing the ~ to a comma?

  4. I love the idea of a built-in word spinner sitting right on my blog. But I’m having trouble with it for now. I am using this format to separate words { | }.
    But I get this message: Warning: split() [function.split]: REG_EMPTY in (my domain stuff here)……/plugins/wordspinner/wordspinner.php on line 120.
    Any chance you would tell me what this means? I would appreciate it very much. Thanks

  5. Glad you got that sorted weareunderscore, thanks!

    Stanly, the reason that isnt working is because the pipe is a special character in regex and php, try using something else to separate the words (you can also do a mysql find and replace like weareunderscore did to fix all your posts at once)

    – K

  6. I installed your word spinner but for some reason it mucked up the short codes on my site. The short codes appeared on the web pages. Do you know what is happening here?

    • @Nik: Is it version 1.3 or 1.4? There was a bug in 1.3 that potentially overwrote Text widgets, and now there are completely separate widgets for Spinable text widgets, so you may have to copy/paste things from text widgets into one of the new Spinning text widgets.

      Other than that all I can think of is that maybe the code you’re inserting contains reserved characters

  7. Hi Kythin, Thanks for this great contribution.

    I want the spinner to run once for each of post and not to change every time page loads. Is that possible ?

    I am not good with PHP and prefer not to mess it up.


    • @matias Probably, but it contradicts the point of my plugin a bit. The way to do it (if you have a php coder friend) would be to look up the wordpress API and find out what hook runs when an author saves the page, and then wrap that in a spin function call. The problem then is that you would lose all your other options in each set of brackets so you wouldn’t be able to re-edit the page in the same way, which brings it back to defeating the point of the plugin…

      what you could also do, is use this page (or download the code and make the textbox much bigger for longer articles) whenever you want a new article spun once, then copy/paste it into your site;

      I MAY add something like this to the options pane in a future update, just so it’s a bit less fussing around, but I’m pretty busy at the moment sorry!

  8. Kythin,

    I must say that I am impressed. Simple, clean and very easy to implement. Kudos to you.

    I have to ask, why did you use “[,]” instead of using the so called standard of “{~}” or the “|” characters?

    And finally, is there a problem changing those three characters within the code? I see where I can change them I just thought I would ask so as to avoid any problems that you may have had.

    Thanks again!


    • @siteblaster Thanks for the kudos! You can change the characters you want to use in the options in the WP admin, The pipe probably won’t work unless you escape it properly, the braces I think should be fine.

  9. @siteblaster

    You should be able to do something like:
    $somestr = “[Phrase 1,Phrase 2,Phrase 3]”;
    echo run_spinner($somestring);

    It will still use whatever characters you have set in your WP options as the end and separation characters though, so make sure they’re the same.

  10. Hey Kythin,

    I am having an issue with a couple of my seasoned plugins not working correctly (I missed them before). I was doing some spinning within some plugin’s CSS and HTML code. Works great in that capacity.

    However, a couple of my plugins use short-codes which look like this {someshort-code]. It appears that WordSpinner actually tries to process this and thus that plugin fails.

    I tried changing the WordSpinners delimiter but I have been met with error codes when I try spinning with them. I tried ” { , } ” as well as ” { | } “.

    How would you change them to use a different escape sequence?

    Would is work by just using dual brackets like [[phrase#1,phrase#2,phrase#3]] ?

    Thanks for your time.

  11. @siteblaster: In theory that would work, if you set WordSpinner to use double brackets it should stop messing with your other shortcodes.

    They could be anything, actually. They dont have to be the same character, and they dont have to be brackets, e.g. it could be set to use %$some*words*to*spin$% for all it cares. (untested, but should work!)

    • it’s a PHP reserved character, so you would need to get into the code of the addon. You will need to add another str_replace(“|”,”\|”,$spintext); or something along those lines.

      it would probably be easier to run a find/replace on your database than code it properly, which is why I didn’t spend any time on it in the first place

      I’ll fix it in a future release (strapped for time in the forseeable future though)

  12. Hi I got the widget, but there is a small problem, when I am trying to make random words for various different links and I use the same words to spin, it creates “STATIC” wording like this (as an example):

    Hi, I’m Jim
    Hi, I’m Joe
    Hi, I’m John

    And I want it to do this:
    Hello, I’m Jim
    Hi there, my name is Joe
    How are you? My name is John

    Is there a way around this flaw, I don’t want it to create the same word or phrase over and over, I am trying to make random “keywords” for internal linking and it is making every keyword the same for each link.

    • Can you tell me the code you’re using to produce these? To make the links as you want above, you’d need 2 or more spinners, e.g:
      (replace [,] with your own characters): [Hello, Hi there, How are you?], [I’m, my name is] [Joe, Jim, John]

    • The plugin doesn’t pull any content, you have to write (or paste) it yourself. It’s out of the project’s scope, and my white hat, to build a content puller.

  13. Hi,

    I love your plugin. It’s exactly what I was looking for! Thank you.

    Is it possible to give this the functionality of two level spinning? Such as:

    The [[bucking,kicking] [bronco,steed],[brown,yellow] [dog,mutt]] was just around the corner.


  14. Hi- I would also very much like to see two level spinning included as I have many pre-formatted articles including this. In the meantime, what happens if you use two level spinning brackets (I suppose the brackets show up in the post, right? when would you be introducing two level spinning.

    • By popular demand, Wordspinner 2.0 has just been released, featuring multi level spinning πŸ™‚ Please be sure to back up your spinner widget texts before updating, though I haven’t touched the code that handles them it never hurts to backup anyway!

  15. Is there a maximum number of sets of spin syntax that Wordspinner 2 will support? If I use a standard length article with word replacement and one level of spin I get this error: Fatal error: Maximum execution time of 30 seconds exceeded in /home/****/public_html/wp-content/plugins/wordspinner/wordspinner.php on line 245
    But if I use just a paragraph or two it seems to be fine.

    • Hi Pikachu,

      I just tested it on an absurdly long article and it worked – took about 5 – 10 seconds to load – but it worked. Maybe you have an error in your syntax somewhere?

      Edit: Or possibly your server is a slow machine?

      Edit2: Pika can you please email me the article you’re trying to spin so I can test it properly – kythin {at} gmail. I’ll run it through my development version and see what’s going on! πŸ™‚

      – K

  16. Hi Kythin,

    Thanks for the update!

    I also got the error message listed above. I have just found that you updated it again however. Was that a fix?


  17. Sorry I wasn’t able to email a document but by the looks of it, everything works now! Pages are loading a lot quicker now thanks!

  18. Could you please change the default [ ] caption characters to the common spintax { } because a) {} are the most common used characters b) (and the more important matter than a) [ ] mess up all the shortcodes you may have included with your pages/posts.

    Thank you!

  19. I want to integrate the plugin so that when a user press on publish when he enters:
    This is a [an example,a demonstration,a demo,a test] of the powers of content spinning

    The content that will be saved on the post is:
    This is an example of the powers of content spinning

    So the content will spin only once and will be saved as regular content.

    How can i do it?
    Can i pay you to do it for me?

    Shahar Manuly

    • I’m not available for paid work at the moment, sorry, too much on already. Saving the post-spun content is outside the scope of the project but it has been asked before it may make it to a later release, but I haven’t got a timeframe for it. Also, do you really want to educate your users about spinning text? It sounds like asking for trouble in my opinion!

  20. Hello,
    Does this plugin have the ability to save copies of spun articles? I would like to be able to have a few articles spun for use in submitting to other article directories.

    The way i see it is that this plugin just spins the content of the post on the fly?


    • It doesn’t save copies of the spun articles, but you can simply refresh the page and copy the text into a text file or something to save different versions πŸ™‚

      Thanks for the comment!

  21. Thanks for the reply kythin but i worked out a way to do what i need. Still love your plugin and will be using it accross multiple sites.

    Keep up the great work

  22. Firstly thanks for the plugin, it is superb…

    I wonder, is there any way to spin the “title” of the widget. The widget spinning is actually one of the plugins major features as far as I am concerned, I tried the brackets on the widget title but could not get it to spin.

    Anyhow is there is a way to do this then that would be the icing on the cake.

    Kindest regards


    • If you’ve had WordSpinner installed for a few versions it may still have kept the old default left/right characters, which since WP 3.0+ are now the same as shortcodes that wordpress uses (square brackets). So make sure you change them to something else, like { curly braces } and that should fix the problem.

Leave a Reply