Stocks Watchlist WordPress Plugin

Stocks Watchlist ImageI finally got around to finishing my Stocks Watchlist WordPress Plugin [download].

The Stocks Watchlist plugin allows you to store stock symbols in your WordPress database and then output these symbols along with their live prices to your WordPress blog. You should be able to see mine in the far right hand column here.

Stocks Watchlist AdminTo add/edit/delete stocks to the watchlist database, go to Manage->Stocks Watchlist in the admin panel.

Here it is possible to add a description to the stock symbol and also enable it to be visible in the output.

To output your stocks watchlist, add the following code to your blog template:

<?php swl_output() ?>

When the stocks watchlist is output, it will retrieve the latest price for the stock from Yahoo Finance and also insert a link to the stocks news page at Yahoo Finance.

The plugin was developed with WP2.1, but should work on all versions. Also, it requires cURL to be enabled on your webserver.

If you would like to give it a go, I would really appreciate some feedback. Also, I would be keen to hear of any features that you would like to see added to the plugin.

Update v1.1 v1.0 has not been working for a while, but I have now fixed the bud.

Download – Stocks Watchlist WordPress Plugin


  1. Great plugin, thanks very much. It works with other stock exchanges if you change the yahoo URL. Mines working with Paris.

  2. First of all thanks for the plugin. However, I get an error message on the manage—> Stocks Watchlist page:

    Warning: Invalid argument supplied for foreach() in /wp-content/plugins/stocks-watchlist.php on line 160


    Fatal error: Call to undefined function: attribute_escape() in
    wp-content/plugins/stocks-watchlist.php on line 196

  3. I have the same problem with your plugin as I do with the SQ alternative. When I put your code in the sidebar, the page freezes at that point.

    All other plugins seem fine.

    Recently updated server to Apache 2.2.6, which also includes a reinstall of PHP 5.2.4. DId we miss something?


  4. It does not seem to working on your site?

    not on mine either?

  5. I had an issue with the stock prices not displaying, and I notice your instance has the same issue. It only shows the symbols. I’m not much of a programmer, but playing around with the PHP code revealed the page pointer returned was a forward to “….. ”

    Anyway… I added:

    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);

    to the list of cURL options and that seems to do the trick.

    Great plugin! Thanks!

  6. Kenya Ziegenhagen says:

    I love the plug-in, great job. I was wondering, is there some sort of way to code in an error message for when yahoo goes down? If it goes down , the plug-in spits out a 404 error code.

    I don’t know much about coding so I’m not sure how to go about fixing this in the event it happens again. It would be nice if when the feed went down, you just got a nice little error message on your page.

  7. Administrator says:

    OK everybody. I have just fixed the plugin.
    I would be keen to get some feedback on how it is working now.

  8. wristshot says:

    Any way to put this in a sidebar widget?

  9. Administrator says:

    @wristshot – I shall try and make it into a sidebar widget soon

  10. Thank you very much!

    It’s realy easy to use…

    Nice Greets from Germany.


  1. […] Stocks Watchlist 1.0.0 ยป Dominic Foster (url) Manage and share your stocks watchlist in WordPress. Use Manage->Stocks Watchlist to set options. Use <?php swl_output() ?> to output your Watchlist. […]