Plugin Directory

Inline Google Spreadsheet Viewer

Embeds public Google Spreadsheets, Apps Scripts, or CSV files in WordPress posts or pages as HTML tables or interactive charts, and more.

Will my website be updated when my Google Spreadsheets change?

Yes. Changes you make to your Google Spreadsheets will be shown on your website within a few minutes.

To improve your website's performance, Inline Google Spreadsheet Viewer automatically caches spreadsheets for 10 minutes. If you are making many changes quickly and/or you don't want to wait for the cache to expire on its own, you can add the use_cache="no" attribute to your shortcode to disable the caching mechanism:

[gdoc key="ABCDEFG" use_cache="no"]

After you save and reload the page, you should see near-instant updates. Note that disabling the plugin's cache can result in decreased performance. Disabling the cache is recommended only for relatively small spreadsheets (less than 100 rows or so) or for debugging purposes.

The default style is ugly. Can I change it?

Yes, if you're able to change your theme's style sheet. The plugin renders HTML with plenty of CSS hooks. Use the igsv-table class from your style sheets to target the plugin's <table> element.

Additionally, each row (<tr>) and cell (<td>) is assigned a specific class attribute value. The first <tr> element is assigned the row-1 class, the second is assigned row-2, and the last row-N where N is the number of rows in the rendered table. Similarly, each cell is assigned a class based on its columnar position; the first cell in a row is assigned the col-1 class, the second col-2, and so on:

.igsv-table .row-2 .col-5 { /* styles for the cell in the 2nd row, 5th column */ }

Finally, both rows and cells (based on columns) are assigned an additional class of either odd or even, allowing for easy zebra-striping in CSS3 non-conformant browsers.

.igsv-table tr.odd  { /* styles for odd-numbered rows   (row 1, 3, 5...) */ }
.igsv-table tr.even { /* styles for even-numbered rows  (row 2, 4, 6...) */ }
.igsv-table td.odd  { /* styles for odd-numbered cells  (column 1, 3, 5...) */ }
.igsv-table td.even { /* styles for even-numbered cells (column 2, 4, 6...) */ }

A table appears, but it's not my spreadsheet's data! And it looks weird!

If you're still using the "old" Google Spreadsheets, you should triple-check that you've published your spreadsheet. Google provides instructions for doing this. Be sure to follow steps 1 and 2 in Google Spreadsheets Help: Publishing to the Web. If you're using the "new" Google Spreadsheets, be sure you've selected either the "Public on the web" or "Anyone with the link" Sharing options for your Google Spreadsheet.

A Google Login page appears where my Google Apps Script output should be.

If a Google Login page appears instead of the output of your GAS Web App, double check that you've deployed your Web App with the "Anyone, even anonymous" access permission. Learn more about GAS Web App permissions.

Nothing appears where my chart should be.

The best way to determine what's wrong with a chart that isn't displaying properly is to try displaying the chart's data as a simple HTML table (by removing the chart attribute from your shortcode), and seeing what the tabular data source looks like.

Charts most likely fail to display because of a mismatch between the chart you are using and the format of your spreadsheet.

Each type of chart expects to retrieve data with a certain number of rows and/or columns. If your Google Spreadsheet is not already designed to create data for a chart, you might be able to use the query attribute to select only the rows and/or columns that the chart you're using expects. Otherwise, consider creating a new sheet with the proper formatting and setting it as the key in your shortcode.

To learn more about the correct spreadsheet formats for each chart type, please refer to Google's Chart Gallery documentation for the type of chart you are using.

Can I remove certain columns from appearing on my webpage?

If you're using the "new" Google Spreadsheets, you can strip out columns by selecting only those columns you wish to retrieve by passing a Google Charts API Query Language query to the shortcode's query attribute. For example, to retrieve and display only the first, second, and third columns in a spreadsheet, use a shortcode like this:

[gdoc key="ABCDEFG" query="select A, B, C"]

Alternatively, you can hide columns using CSS with code such as, .col-4 { display: none; }, for example.

How do I change the default settings, like can I turn paging off? Can I change the page length? Can I change the sort order?

All of these DataTables options are accessible through shortcode attributes. The shortcode attribute is an underscore-separated version of the DataTables's CamelCase'ed option name, prefixed with datatables_. For instance, to turn off paging, you need to set the DataTables paging option to false, so you would use a shortcode like this:

[gdoc key="ABCDEFG" datatables_paging="false"]

Similarly, to change how many rows appear per page, you need to use the DataTables pageLength option, setting it to a number. Its default is 10, so if you wanted to show 15 rows per page, you would use a shortcode like this:

[gdoc key="ABCDEFG" datatables_page_length="15"]

Some DataTables options need to be given JavaScript array literals, such as in the case of the DataTables order option, which controls the initial sort order for a table. However, using square brackets ([ and ]) inside a shortcode confuses the WordPress parser, so these characters must be URL-escaped (into %5B and %5D, respectively). Suppose you want your table to be sorted by the second column in descending order (instead of the first column in ascending order, which is the default). You need to supply a 2-dimensional array such as [[ 1, "desc" ]] to DataTable's order option (column counting begins at 0). In a shortcode, with the square brackets URL-escaped, this becomes:

[gdoc key="ABCDEFG" datatables_order='%5B%5B 2, "desc" %5D%5D']

Note that when a JSON string literal is supplied in a shortcode attribute ("desc"), it must be double-quoted, so the shortcode attribute value itself must be single-quoted.

Alternatively, if you're able to add JavaScript to your theme, you can do all of these things, and more because any and all DataTables-enhanced tables can be modified by using the DataTables API.

For instance, to disable paging, add a JavaScript to your theme that looks like this:

jQuery(window).load(function () {

Or, to have your DataTables-enhanced table automatically sort itself by the second column in descending order:

jQuery(window).load(function () {
    jQuery('#igsv-MY_TABLE_KEY').dataTable().api().order([1, 'desc']).draw();

(Replace MY_TABLE_KEY with the Google Spreadsheet document ID of your spreadsheet, of course.)

Please refer to the DataTables API reference manual for more information about customizing DataTables-enhanced tables.

Another option for sorting your table, for example, is to use the query attribute and pass along an appropriate Google Charts API Query Language query that includes an order by clause. In this case, however, you may want to disable DataTables's client-side sorting, as the data will be sorted in the HTML source.

How do I customize my chart?

Using specific shortcode attributes, you can choose from a huge number of configurable options to customize the look and feel of your chart. The specific shortcode attributes available to you depend on the type of chart you chose. Refer to the Google Chart API documentation to learn which configuration options are available for which type of charts.

Each configuration option is accessible through a shortcode of a similar name. For instance, the colors configuration option is accessible to you through the chart_colors attribute. It accepts a list of colors, which you supply to the shortcode in a similar way as you might provide a class value:

[godc key="ABCDEFG" chart="Pie" chart_colors="red green"]

To create a 3D chart, specify chart_dimensions="3".

With a few exceptions, the name of a shortcode attribute is always an underscore-separated translation of the camelCase name of the option in the Google Chart API. For instance, to disable chart interactivity by setting the chart's enableInteractivity option to false, use a shortcode like:

[gdoc key="ABCDEFG" chart="Pie" chart_enable_interactivity="false"]

Some configuration options call for an Object value. For these, the shortcode attribute value should be a JSON object. For instance, to use the different properties of the backgroundColor option:

[gdoc key="ABCDEFG" chart="Pie" chart_background_color='{"fill":"yellow","stroke":"red","strokeWidth":5}']

Note that when a JSON object is used as a value, the shortcode attribute's value must be single-quoted.

See Other Notes for a complete list of attribute for configurable chart options.

Why am I getting errors when I try to use the `query` attribute?

If your query includes an angle bracket, such as a less than (<) or a greater than (>) sign, WordPress will assume you are trying to write HTML and strip everything except the first word of your query, resulting in a syntax error. Instead, use the URL-encoded equivalents of these characters (%3C and %3E, for < and >, respectively), which WordPress will pass to the plugin unmolested and which the plugin is specifically aware of how to handle correctly.

Requires: 3.5 or higher
Compatible up to: 4.3.1
Last Updated: 2015-9-22
Active Installs: 5,000+


4.5 out of 5 stars


53 of 55 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

0,1,0 100,1,1
100,1,1 0,1,0
100,1,1 100,1,1 100,1,1 100,1,1