How to Add a Stock Market Ticker to WordPress

If you’ve ever envied the big financial sites with their up-to-the-minute stock market data, now you can have the same functionality on your site. Adding stock market data to your WordPress website is easy with a stock market ticker plugin.

“Ticker” is one of those funny names that’s a holdover from long ago. Mechanical stock market tickers were used for 100 years, but in the 1960s, they became obsolete when computers took over the delivery of stock market data.

Yet here we are, half a century later, still calling any dynamic listing of stock data a “ticker.”

Be that as it may, once you’ve decided that you want a stock market widget for your website, there are more than a few to choose from. They’re all variations on the same theme, but we like the Stock Ticker WordPress plugin, so that’s what we’re going to use here.

Installing the Stock Ticker WordPress Plugin

Log in to your WordPress admin panel.

In the left column navigation mouse over the “Plugins” link and click the “Add New” link.

mouse over the "Plugins" link and click the "Add New" link

In the “Search plugins…” box, enter “Stock Ticker.”

search for the WordPress Stock Ticker plugin

Once you have located the plugin, click the “Install Now” button.

click to install the WordPress Stock Ticker plugin

When the plugin has been installed, click the “Activate” button.

click to activate the WordPress Stock Ticker plugin

Obtaining and Entering an API Key

Before you can use the Stock Ticker WordPress plugin, you have to get an API key from AlphaVantage.co. Alpha Vantage supplies the quote data for the plugin (which is updated every 15 minutes). They can provide data from 23 different exchanges, so they likely have you covered no matter which exchanges you’re interested in.

You can get a free API key that is limited to five requests per minute. If you want to update more than five times per minute, premium tiers are available. From what I can see, if you maintain a relatively small list of stock symbols, the free API does the job quite well.

“Requests” are API calls, not page loads, so most of us won’t have to worry about too many visitors crashing the plugin. I tried to crash it with a URL tester loading the site from 25 different locations simultaneously, and I couldn’t kill it. But if you do need to increase API calls, the premium tiers are available.

Once you have the API key, here’s how you add it to the stock market ticker. In the left column navigation, mouse over the “Settings” link and click the “Stock Ticker” link.

click the "Stock Ticker" link

The first of the general settings is “AlphaVantage.co API Key.” Enter your key in the field, scroll down to the bottom of the page, and click the “Save Changes” button.

enter your key in the field

click the "Save Changes" button

You can configure which stocks are displayed using added shortcode elements. But for this tutorial, we’re going to use the generic shortcode without any customization. We’ll do all of our customizations in the plugin settings.

Basic Stock Ticker Plugin Configuration

By default, the plugin shows stock market ticker data for Microsoft, Apple, and Intel. So right out of the box, if you enter the [stock_ticker] shortcode into a post or page, the information for those stocks will scroll across the screen.

enter the [stock_ticker] shortcode into a post or page

information for the stocks will scroll across the screen

If you go to the “All Stock Symbols” field, you’ll see the ticker symbols for Microsoft, Apple, and Intel (AAPL,MSFT,INTC).

ticker symbols for Microsoft, Apple, and Intel

Those are all well and good, but it’s getting close to lunchtime as I type this, so let’s add something tastier. Like Pizza Hut, Chipotle, and Ruth’s Chris Steak House (YUM,CMG,RUTH).

And since I’m more likely to be eating a cup of noodles than steak, we’ll add Nissin (NFPDF) as well.

ticker symbols for food companies

After the “All Stock Symbols” field has been updated, scroll down and click the “Save Changes” button.

click the "Save Changes" button

Since we’ve changed the data we’re requesting from the API, in the “Force data fetch” section, click the “Fetch Stock Data Now!” button. The display will let you know when the data has been fetched.

the display shows the fetched data

As you can see, the plugin fetches data for all of the ticker symbols listed in the “All Stock Symbols” field. We added to that list rather than replacing AAPL,MSFT,INTC because we may want to display the tech company data at some point.

But if you are not likely to display data for one or more of the symbols, it’s best to delete them from the “All Stock Symbols” field.

A bit further down, in the “Stock Symbols” section, is where we list the stocks that we want to display. We want to stop displaying the tech companies data and replace them with the food companies. So we replace the tech company symbols with the food company symbols.

replace the tech companies with the food companies

Scroll down and click the “Save Changes” button, and you can see that the food companies have replaced the tech companies in our post.

the food companies have replaced the tech companies

Adding Company Names

As you can see, the data for our newly added symbols is showing up fine, but the company names are missing. If the symbols alone serve your purposes, you don’t have to change anything.

But if you want to display the food company names the same way the tech company names were displayed, scroll down to the “Custom Names” section.

Here you will add the stock ticker symbol followed by a semicolon and the company name. So I’m going to add:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]YUM;Pizza Hut
CMG;Chipotle
RUTH;Ruth’s Chris Steak House
NFPDF;Nissin Cup Noodles[/ht_message]
adding to the "Custom Names" section

Scroll down and click the “Save Changes” button.

Now the company names are displayed.

company names are displayed

Note that if you want to display the company name and the ticker symbol, you will update the “Custom Names” section with something like this:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]YUM;Pizza Hut (YUM)
CMG;Chipotle (CMG)
RUTH;Ruth’s Chris Steak House (RUTH)
NFPDF;Nissin Cup Noodles (NFPDF)[/ht_message]

Displaying Currency Markets

Another cool thing the Stock Ticker plugin will do is display currency markets.

If you scroll down to the bottom of the “Custom Names” section, you can see an example, comparing the Euro to the British Pound.

example comparing Euro to British Pound

So for example, if we wanted to see where the Euro stands in relation to the U.S. Dollar, we could copy that line in the “Custom Names” section, paste it below the Euro/Pound line and edit it.

edit the Euro/Pound line

Then in both the “All Stock Symbols” and “Stock Symbols” fields, enter EURUSD.

in the "Stock Symbols" field, enter EURUSD

Scroll down and click the “Save Changes” button.

Click the “Fetch Stock Data Now!” button.

Now our site displays the relationship between the Euro and the Dollar.

Euro VS Dollar

Not for Investing Purposes

You may have noticed the disclaimers made by the plugin author, stressing that the plugin should be used “for informational and educational purposes only,” and that it shouldn’t be considered investment advice. That’s true, and we should probably reiterate that point.

The stock data is provided by a third party, and it is delayed up to 15 minutes, so you probably wouldn’t want to be hitting refresh on a browser running this plugin, using it to decide when to BUY! or SELL!

Would you consider using this plugin on a financial-themed site? Can you think of any cool uses for the currency comparison data?

2 thoughts on “How to Add a Stock Market Ticker to WordPress”

  1. Hi Michael,

    Thanks very much for this information! We are currently using this stock ticker for a client’s website and it looks great.

    I was just wondering which third party you are using to gather this stock data? I think the delay in stock price updates may be greater than 15 minutes since we are noticing about a 24-hour delay before the price changes on the website. Maybe it updates after the markets close or something like that? Any input would be greatly appreciated

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.