Easy Random Quotes

Insert quotes and pull them randomly into your pages and posts (via shortcodes) or your template (via template tags).
Can refer to quote IDs to use specific quotes. Also widget-enabled


Latest version: Download Easy Random Quotes v1.8


  1. Upload the contents of the zip file to the your plugins directory (default: /wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to the Easy Random Quotes page under Settings
  4. Add/edit the quotes you’d like to use on your site
  5. To display in a page or post, use the short code: [erq], or [erq id={id}] if you’d like to use only a specific quote
  6. To add to your template, use the template tag: <?php echo erq_shortcode(); ?>, or <?php echo erq_shortcode(array('id' => '{id}')); ?> if you’d like to use only a specific quote



  • maintenance


  • New: Random quotes from a given list of ids: [erq id=’2,4,6′]
  • General cleanup


  • adds import option


  • fixed issue where widget would try to display non-existant (deleted) quotes
  • general updating, code cleaning
  • utilizes contextual help in WordPress


  • added reset button to delete all quotes without uninstalling
  • added title option in widget
  • ready for localization


  • fixed data storage/retrieval issue


  • Actually fixed php error when saving data – seriously, if you’ll tell me it’s broken, I can fix it faster and I won’t look like an idiot for so long…


  • Fixed php error when saving data


  • Initial Release

37 thoughts on “Easy Random Quotes”

  1. Getting this error when I try to add a quote. I’m using WP 3.0.

    Warning: unserialize() expects parameter 1 to be string, array given in (site directory removed)/wp-content/plugins/easy-random-quotes/kl-easyrandomquotes.php on line 133

  2. Fatal error: [] operator not supported for strings in /[myhost]/wp-content/plugins/easy-random-quotes/kl-easyrandomquotes.php on line 61

    Running v1.1 of plugin with WP 3.0 and the Thesis theme.

    1. Uhh….

      Thanks for catching that. I must not have cleared my settings before testing my last supposedly ‘fixed’ release.

      Anyhow, I did a fresh install, got the error, and have fixed it. There should be a 1.2 update for you momentarily.

      Sorry about that, and again, thanks for taking the time to let me know!

  3. Hi, I just ‘upgraded’ the plugin and now it is no longer working. This is the error I get:

    Warning: unserialize() expects parameter 1 to be string, array given in /wp-content/plugins/easy-random-quotes/kl-easyrandomquotes.php on line 169

    Any ideas on how I can fix this?

  4. Hi Trepmal, that is nice plugin. I have some comments to make it even nicer!

    – adding a language file for those who want to translate it.
    – adding some formating to the widget
    – enabling widget title
    – adding Ajax for changing displayed qoutes.

    keep up the good work πŸ˜‰

    S. Samir

    1. Thanks for the tips!

      I’m getting ready to release update that adds the language file, and the widget title.

      I’ll make a note about adding Ajax in the future.

  5. Hi!

    I would love to thank you for the great plugin. I am planning to use it in my personal site. I was wondering if it would be possible to exclude a quote from the list of quotes?

    What I mean is.

    I would like to use a certain quote only in the homepage so Im using this code:
    '{id}')); ?>

    And I want it to be excluded from showing up from other pages where I use this code:

    Hoping for your quick response.


    1. This is not currently an option with the plugin – but I will try to add this feature to the next version. Thanks for your feedback

  6. I tried using your plugin as a widget, and had a problem that I finally traced down to trying to use a blank title. Doing this caused an extra closing div, which made my footer fall out of the container and break. This happened even with no quotes entered yet.

    Unfortunately, the site I’m working on specified the quote without a title, so either I need to patch your code, use an invisible title, or us an inferior product. πŸ™‚

    Don’t worry, I won’t hold you responsible for damage to my footer when it fell out of its div. Fortunately, nobody was hurt.

    1. Hmm.. the widget doesn’t add (or remove) any divs. Is it possible that the settings for that sidebar causes an extra closing div when there’s no title?

      1. Well, I’m trying to figure out what’s going on. I’m even more confused, because now I seem to be having a problem even if there is a title. It could very well be something in the theme, which was bought by my customer from ThemeForest. I’m having trouble figuring out what divs match up.

        I’m looking at the functions.php, and they have this:

        'before_widget' => '',
        'after_widget' => '',
        'before_title' => ' ',
        'after_title' => '',

        To me, it looks like it might depend on having a title, although I’m just learning WordPress, so I may be missing something. I’ll see if I can reproduce it with a different widget.

        Thanks for your response. I’ll let you know.

        1. oops. I see my tags got stripped out. Kinda loses its effect. πŸ™‚
          Basically, the after_title had an opening div, and the after_widget had the closing div.

      2. I realized that the text widget would be an easy test, and sure enough, it caused the same problem with no title. This explains why I began having the problem even with a title using your widget – I had added an image using the text widget at the same time, with no title!

        I’ll complain to ThemeForest or the developer (and my client). Anyway, I did learn a lot more about WordPress inner workings.

  7. Awesome script, but might there be any way to have the widget list say, two, five or ten random quotes at a time in a sidebar?

    1. Version 1.6 should be available soon and includes an import option.

      It currently requires copy & paste, but should hopefully work out until a more robust option is added.

  8. Installed and configured in Settings, but I see no widget available in Appearance >Widgets. What am I doing wrong?

  9. You rock! Thanks for making Version 1.6 available with import features!

    I pasted 583 single line quotes and they were imported perfectly in just seconds!

    I also tried pushing it with the full 6,562 quotes, it choked on that, but figured that may have been more than the database could handle.

    Awesome job, thanks so much for the plugin!

  10. Thank you for the Plugin. Excellent work.
    May I ask – is it possible to pull in an array of Id’s into the short code.
    [erq id=8,9,14]
    This is because I use your plugin for testimonials and provide a number of different services. It would be great to use the testimonials relating to each service page.

    Thanks again (still a great plugin)

    1. Unfortunately, this is not currently a possibility. However, I do have a new version of this plugin in the works that should be a lot more customizable. Hopefully I’ll be able to make some time to finish and release it… πŸ™‚

      1. Hi,

        Did you find any time to implement this ‘most wanted’ feature? I’m looking forward to it a lot.

  11. Thanks, this works great. One question I didn’t see above. I’d like to have a non-admin user be able to enter quotes, but since it’s on the Settings menu they don’t see the menu at all.

    Is there any way to put the editor where the Editor role can see it?


    1. You’ll need to edit the plugin. Find line 38 of kl-easyrandomquotes.php and replace it with this:
      $page = add_menu_page( 'Easy Random Quotes', 'Easy Random Quotes', 'edit_pages', __FILE__, array( &$this, 'page' ) );

      This moves the plugin out of Settings allows users with the ability to edit pages to access the plugin.

  12. Hello!!
    The plugin works and it’s awesome. Thanks a lot!
    But how can I have my quotes in a box?
    Because they are overlapping at the sidebar. I wish
    I can have even simple box to prevent ’em overlapping.

  13. How can I change the formatting of the quotes, e.g. changing font color? Great plugin by the way. Works like a charm. Thanks.

    1. I’ve discovered that the plugin call an id #kl-erq-2 by declaring this id in the css template editor and specifying the colors and font size, it works.

      hope this answers your question

  14. I’m just keep getting this error message.
    When i try and update an new quote.

    Warning: Invalid argument supplied for foreach() in /home/wedesign/public_html/progress/R3no/wp-content/plugins/easy-random-quotes/kl-easyrandomquotes.php on line 121

    Thanks in advance

  15. Great Plug-in, thank you for that. Just a small question.

    Before each quotes, I would like to have a floating div on the left with a big “quote” symbol.

    I am trying to figure out how to do so. Is it something that I could do in the css or something I should add in the code.

    The way that I would like it to be is that the user doesnt have to constantly copy/paste ” before each quotes.

    Please help

Comments are closed.

Please use this plugin's WordPress.org support forum if you need assistance.