Easily turn data stored in a Google Spreadsheet, CSV file, MySQL database, or the output of a Google Apps Script into a beautiful interactive chart or graph, a sortable and searchable table, or both. Embed live previews of PDF, XLS, DOC, and other file formats supported by the Google Docs Viewer. A built-in cache provides extra speed.
Donations for this plugin make up a chunk of my income. If you continue to enjoy this plugin, please consider making a donation. 🙂 Thank you for your support!
Paste the URL of your public Google Spreadsheet or Google Apps Script Web App on its own line in your WordPress post or page, then save your post. That’s it. 🙂 Your data will appear in a sorted, searchable HTML table. Web App output will be displayed using the HTML defined by the Web App. See the screenshots for an example.
If using a Google Spreadsheet, the spreadsheet must be shared using either the “Public on the web” or “Anyone with the link” options (learn how to share your spreadsheet). Currently, private Google Spreadsheets or Spreadsheets shared with “Specific people” are not supported. Web Apps must be deployed with the “Anyone, even anonymous” access permissions. CSV files must be available to the public, without the need to log in to the site where they’re hosted.
This document is the only support document for this plugin.
Due the sheer volume of repetitive posts asking questions that have already been answered in this document or by earlier postings on the support forum, I no longer volunteer any of my time to give support to users of this plugin under any circumstances beyond the documentation I have already produced.
In other words:
There are more than ten years of questions and answers to those questions covering almost every conceivable use case and situation in which this plugin has been used or is likely to ever be used on the support forum that I have been present for. The meager amount of donations I receive for this plugin does not even register against the fathomingly high amount of effort I have put into monitoring support queries for this plugin. Worse, this effort was often in vain because the answers to the questions almost every single person who asked a question was seeking was already answered in this document or in a previous posting already. Enough is enough.
Your only options to get support for this plugin are:
Hopefully, since no one can actually get my support any longer, more of them will do the thing they should have done in the first place and actually read this document, saving everyone involved a lot of time.
You can transform your spreadsheet into an interactive chart or graph, embed documents other than spreadsheets, and customize the HTML of your table using a [gdoc key=""] WordPress shortcode. The only required parameter is key, which specifies the document you’d like to retrieve. All additional attributes are optional.
Google Spreadsheets
After saving the appropriate Sharing setting, copy the URL you use to view the Google Spreadsheet from your browser’s address bar into the shortcode. For example, to display the spreadsheet at https://docs.google.com/spreadsheets/d/ABCDEFG/edit#gid=123456, use the following shortcode in your WordPress post or page:
[gdoc key="https://docs.google.com/spreadsheets/d/ABCDEFG/edit#gid=123456"]
CSV files
Using a CSV file works the same way as Google Spreadsheets. Set the key to the URL of the file to display it as an HTML table:
[gdoc key="http://example.com/research_data.csv"]
HTML Tables
Customizing the HTML tables that are produced is easy. For instance, to supply the table’s title, <caption>, and a customized class value, you can do the following:
[gdoc key="ABCDEFG" class="my-sheet" title="Tooltip text displayed on hover"]This is the table's caption.[/gdoc]
The above shortcode will produce HTML that looks something like the following:
<table id="igsv-ABCDEFG" class="igsv-table my-sheet" title="Tooltip text displayed on hover"> <caption>This is the table's caption.</caption> <!-- ...rest of table code using spreadsheet data here... --> </table>
By default, all tables are progressively enhanced with jQuery DataTables to provide sorting, searching, and pagination functions on the table display itself. If you’d like a specific table not to include this functionality, use the no-datatables class in your shortcode. For instance:
[gdoc key="ABCDEFG" class="no-datatables"]
Web addresses and email addresses in your data are turned into links. If this causes problems, you can disable this behavior by specifying no to the linkify attribute in your shortcode. For instance:
[gdoc key="ABCDEFG" linkify="no"]
Each table can be customized per-table, using shortcode attributes, or globally for your entire site, using the plugin’s settings screen. You can freeze the table header, columns, control pagination length, and more. Refer to the Other Notes section for a full listing of supported customization attributes.
Charts
Data from Google Spreadsheets or CSV files can be graphed in interactive charts. To visualize your data as a chart, add the chart attribute to your shortcode and supply a supported chart type. You can make:
For example, if you have data for a sports league that records the goals each team has scored (where the first column is the team name and the second column is their total goals), you can create a bar chart, with an optional title, from that data using a shortcode like this:
[gdoc key="ABCDEFG" chart="Bar" title="Total goals per team"]
You can customize your chart with a number of options, such as colors. For example, to create a 3D red and green pie chart whose slices are labelled with your data’s values:
[gdoc key="ABCDEFG" chart="Pie" chart_colors="red green" chart_dimensions="3" chart_pie_slice_text="value"]
Pre-processing data with Google Queries
You can pre-process your Google Spreadsheets or CSV files before retrieving data from them by passing a Google Charts API Query Language query to the shortcode’s query attribute. This lets you interact with the data in your Google Spreadsheet or CSV file as though it were a relational database table. For instance, if you wish to display the team that scored the most goals on your website, you might use a shortcode like this to query your Google Spreadsheet and display the highest-scoring team, where the team name is the first column (column A) and that team’s score is the second column (column B):
[gdoc key="ABCDEFG" query="select A where max(B)"]
Queries are also useful if your spreadsheet contains complex data from which many different charts can be created, allowing you to select only the parts of your spreadsheet that you’d like to use to compose the interactive chart.
Using a MySQL Database
After an administrator enables the SQL queries option in the plugin’s settings screen, privileged users can also retrieve data from the WordPress database by supplying the keyword wordpress to the key attribute of your shortcode along with a valid MySQL SELECT statement. This can be useful for displaying information that other plugins save in your website’s database or that WordPress itself maintains for you.
For example, to show a table of user registration dates from the current blog:
[gdoc key="wordpress" query="SELECT display_name AS Name, user_registered AS 'Registration Date' FROM wp_users"]
Remote MySQL databases are also accessible by supplying a MySQL connection URL with valid access credentials. For example, to show the prices from an inventory database hosted by a MySQL server at server.example.com by logging in as user with the password password and querying for items that are in stock:
[gdoc key="mysql://user:[email protected]/inventory" query="SELECT sku AS 'Item No.', product_name AS Product, price AS Price WHERE in_stock=TRUE"]
Using Google Apps Script Web Apps
You can also supply the URL endpoint of any Google Apps Script Web App to retrieve the output from that app and insert it directly into your WordPress post or page. This works exactly the same way as Google Spreadsheets do, so you can use this feature to display arbitrary data on your WordPress site.
For example, suppose you maintain a GMail account for fans of your podcast to write you questions, and you want to automatically display some information from these emails on your website. Using GMail filters and labels, you can access these emails through a Google Apps Script that reads your email, counts the number of mail messages in your different labels, and returns that count as an HTML list fragment. Deploy that Google Apps Script as a Web App and supply its URL to the gdoc shortcode:
[gdoc key="https://script.google.com/macros/s/ABCDEFG/exec"]
Now your website is automatically updated whenever you receive a new question in email from your listeners.
Embedding other documents
You can also supply the URL of any file online to load a preview of that file on your blog. To do so, supply the file’s URL as your key:
[gdoc key="http://example.com/my_final_paper.pdf"]
To tweak the way your preview looks, you can use the width, height, or style attributes:
[gdoc key="http://example.com/my_final_paper.pdf" style="min-height:780px;border:none;"]
If you like this plugin, please consider making a donation for your use of the plugin, purchasing one of Meitar’s web development books or, better yet, contributing directly to Meitar’s Cyberbusking fund. (Publishing royalties ain’t exactly the lucrative income it used to be, y’know?) Your support is appreciated!
This plugin provides one shortcode (gdoc) that can do many things through a combination of shortcode attributes. Every attribute must have a value. These attributes and their recognized values are documented here.
To use chart customization options, you must also choose a chart type by including the chart attribute.
The complete list of attributes for configurable chart options is below. Refer to Google’s Chart Gallery documentation for the type of chart you are using to learn more about which chart types support which chart options.
To use DataTables customization options, you must not supply the no-datatables class.
The complete list of core DataTables customization attributes is below. Please refer to the DataTables Options reference for more information about each particular option.
In addition to the above, the following included DataTables extensions can be customized through these additional shortcode attributes:
This section documents hooks that the plugin implements. Developers of other plugins or themes can use these in their code to customize the way this plugin works.
This plugin unconditionally loads numerous scripts in order to make it possible to enhance statically-defined tables (i.e., tables not generated automatically from a remote datasource). For performance reasons, some site administrators prefer not to load these scripts on all pages, so they can selectively dequeue any script or stylesheet this plugin adds by using the gdoc_enqueued_front_end_* filters to remove the scripts with the associated handle. The registered handles are listed here.
Scripts
Stylesheets
Starting from $0 per month.
Rating
Reviewers
68 reviews
Tags
Developed By
Meitar
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Bringing Your Business Locations Closer to Your Site Visitors
Create Stunning RSS Feeds & Improve User Experience
Draw Attention to Information, Wow Users & Improve Navigation
Present Information in an Organized, Visually Appealing Manner
Create Stunning Pinterest Feeds & Improve User Experience
Capture Interest, Gather Contacts, Boost Website Conversions
Create Stunning Facebook Feeds & Improve User Experience
Add real-time, personalized weather updates effortlessly
Empowering Your Headlines with Unique Highlights and Personalized Touch
Offer Valuable Information and Promote Your Products With a PDF Viewer Gallery
Notify users, encourage action & greatly improve conversions.
Increase Customer Confidence with Customizable Trust Badges
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!