InstaCharts logo WordPress InstaCharts + WordPress

Embed a Chart in WordPress

Add an interactive chart to any WordPress post or page

WordPress powers blogs, news sites and business websites, and a chart helps readers follow the numbers in an article. InstaCharts gives you an Embed Tag that works in the Custom HTML block that ships with WordPress, so a chart can go into any post, page or widget area with no chart plugin to install.

  • Live and interactive
  • Updates when your data changes
  • Free plan available

Website Traffic Share by Source

Live
Website Traffic Share by Source 100% stacked area chart made with InstaCharts

A live 100% stacked area chart embedded with InstaCharts, the kind of chart you can add to WordPress. Hover over the chart to see each value.

Open Template

At a glance

What you need to embed a chart in WordPress

An InstaCharts chart shared publicly, its Responsive Embed Tag, and a Custom HTML block on your WordPress page.

Code to copy

Responsive Embed Tag

Where it goes in WordPress

Custom HTML block

Updates

Automatic when the chart or its data changes

About WordPress

What is WordPress?

WordPress is free, open source software for building websites and blogs, first released in 2003. It runs personal blogs, news sites, business sites and online stores. Sites can be self hosted with the software from WordPress.org or hosted on WordPress.com, and the block editor builds each post and page from blocks such as paragraphs, images and Custom HTML.

Visit wordpress.org

In InstaCharts

Make the chart and copy its embed code

  1. Step 1

    Add your data

    Upload a CSV or Excel file, paste a table, import a file from a web link or connect a Google Sheet. InstaCharts reads your columns and suggests a chart.

    To add a new sheet, launch the Add New Sheet dialog. There's a few ways to import your data, the easiest is Blank Sheet. In the empty spreadsheet on the Blank Sheet page, paste in your data straight from Excel. Click Next to see a data preview, then click Import. InstaCharts then draws a chart from the data automatically.

  2. Step 2

    Pick and style the chart

    Choose the chart type and the columns for each axis, then set the title, colors and labels. Charts made from a synced Google Sheet or web link keep updating.

    Easily change the shape of the chart using the Chart Type dropdown. Here, we are changing from a bar chart to a pie chart. Use the right click menu to show data labels on the pie chart, and to hide the legend. Finally we will change the chart theme and color scheme to get our chart to match our website.

  3. Step 3

    Share it and copy the Responsive Embed Tag

    Click Share on the toolbar, choose Share Chart and set the share mode to Public. Under Embed in a webpage, choose Responsive next to Embed Tag and copy the code.

    Click Share on the toolbar to open the Share & Templates dialog. Change the pie chart's share mode to Public. Under the Embed in a webpage tab, keep Responsive selected and copy the embed code.

In WordPress

Add the chart to WordPress

Paste the Responsive Embed Tag into a Custom HTML block.

  1. 4

    Step 4

    Add a Custom HTML block

    In the block editor, click the plus button where the chart should go, search for Custom HTML and add the block.

  2. 5

    Step 5

    Paste the Embed Tag

    Paste the Responsive Embed Tag you copied from InstaCharts into the block. Click Preview in the block toolbar to see the chart.

  3. 6

    Step 6

    Publish or update the post

    Save the post and view it on your site. The chart fills the width set in the Embed Tag and shrinks to fit narrow screens.

What the Responsive Embed Tag looks like

Copy your own code from the Share dialog. YOUR_CHART_ID stands for the id InstaCharts gives your chart.

<div class="instacharts-embed" data-src="embeds/YOUR_CHART_ID" style="width:600px; max-width:100%;">
<iframe src='https://instacharts.io/app/embeds/YOUR_CHART_ID' title="Quarterly Revenue" width="100%" height="600px" style="border-radius:6px; border: 1px solid rgba(0, 0, 0, 0.1); background:#ffffff;" frameborder="0" data-responsive="1"></iframe>
<script src="https://instacharts.io/app/scripts/embed.js" ></script>
</div>

Tips

Tips for charts in WordPress

  • In the classic editor, switch to the Text tab before pasting. The Visual tab shows pasted HTML as plain text.
  • Turn on SEO caption in the Share dialog to add a caption below the chart with its title and a description of its data. The caption sits in your post's HTML, so search engines index it with the article.
  • Turn on SEO data to add a JSON-LD script that describes the chart as a schema.org Dataset, with its title, columns and source.
  • Some hosted WordPress plans and security plugins remove iframe and script tags when a post is saved. If the block is empty after saving, try the Iframe Only Embed Tag, or use a shared chart image from the Share Image tab.

FAQ

Embedding charts in WordPress: FAQ

Answers to common questions about adding InstaCharts charts to WordPress.

Do I need a WordPress chart plugin?

A plugin is optional. The Custom HTML block that comes with WordPress holds the InstaCharts Embed Tag, and you build and edit the chart in InstaCharts.

Can I add a chart to a WordPress sidebar or footer?

Yes. Go to Appearance, Widgets, add a Custom HTML block to the sidebar or footer and paste the Embed Tag. Use the Customize toggle in the Share dialog to set a width that fits the sidebar before you copy the tag.

How do I make the chart readable by search engines?

Turn on SEO caption and SEO data next to the Embed Tag in the Share dialog. The caption adds visible text about the chart to your post, and the SEO data adds JSON-LD that describes the chart's title, columns and source.

Does an embedded chart update when my data changes?

Yes. The embed loads the chart from InstaCharts each time the page opens, so changes to the chart and new data from a synced Google Sheet, a web link or Zapier show up with no new embed code.

Is it free to embed a chart?

Yes. The free plan includes 200 share and embed views a month, and free charts show an InstaCharts watermark. Paid plans remove the watermark and raise the limit to 1,000 views a month on Starter and 100,000 on Pro.

Can I embed a data table or a dashboard?

Yes. Turn on Full Dataset or Plotted Data in the Settings tab of the Share dialog to add sortable table views to the chart embed. Dashboards have their own Share dialog with an Embed URL and Embed Tag.

Can I see where my chart is embedded?

Yes, on paid plans. The Analytics tab of the Share dialog counts embed views apart from share link views and lists the top pages that load the chart.

Want the full reference?

Read the embed charts documentation for sizing, the embed toolbar, SEO options and domain whitelisting.

Related guides

Explore

Embed a chart on another platform

Step by step guides for every website builder and app InstaCharts covers.

See which embed code each platform needs on the embed a chart page.

Make a chart for your WordPress page

InstaCharts makes data visualization easy, so you can build clear reports without design experience.