Title: Google spreadsheet embed problem
Last modified: August 24, 2016

---

# Google spreadsheet embed problem

 *  Resolved [behindthebets](https://wordpress.org/support/users/behindthebets/)
 * (@behindthebets)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/)
 * Hi,
 * I love your plugin. It has been a life saver. I have run into one problem. I 
   am posting Google Spreadsheets, and I can only get the first page tab to post.
   I tried using the gid=”2″ to display page 2 but page 1 still displays. I had 
   to copy the page to a new spreadsheet to get it to work. Here is what I am literally
   posting (I disabled the copy, paste, etc at the end thanks to your amazing shortcodes):
 * [gdoc key=”[https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/pubhtml?gid=0&single=true&#8221](https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/pubhtml?gid=0&single=true&#8221);
   gid=”2″ datatables_dom=’lfrtip’]
 * What am I doing wrong here? I thought I would just change the gid number and 
   each spreadsheet tab (I have 8 on each spreadsheet) would display.
 * [https://wordpress.org/plugins/inline-google-spreadsheet-viewer/](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165133)
 * You have the right idea with the `gid` parameter but you’re not using the right
   values. Google doesn’t reference individual sheets sequentially. The second sheet
   is not necessarily `2`. It might be, but it might not be.
 * If you’re using a recent version of the plugin and the new Google Sheets (and
   it looks like you are), you can just copy and paste the URL you use to edit the
   specific sheet and the plugin will extract the correct value for the `gid` attribute
   automatically. Otherwise, you need to inspect the URL yourself and find what 
   the sheet’s ID number is. It’s always going to be after the `gid=` part of the
   URL, so whatever number comes after that in the URL is the value you want to 
   put into the `gid` attribute.
 * Hope this helps.
 *  Thread Starter [behindthebets](https://wordpress.org/support/users/behindthebets/)
 * (@behindthebets)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165135)
 * I sort of understand. The URL to the next page is as follows:
 * [https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/edit#gid=1388495398](https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/edit#gid=1388495398)
 * Would I put all of those numbers in the gid=”numbers” code?
 *  Thread Starter [behindthebets](https://wordpress.org/support/users/behindthebets/)
 * (@behindthebets)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165138)
 * I just tried it and it worked! 🙂
 * Thank you so much. I thought it was just one number instead of a string of values
   in the URL.
 * Great plugin and great customer service!
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165217)
 * 🙂 Glad you got it working.
 * For future reference, yes, for the sheet you’re trying to embed that has the 
   URL you mentioned, one could either use the `gid` attribute explicitly, like 
   this:
 *     ```
       [gdoc key="https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/edit" gid="1388495398"]
       ```
   
 * or you can just use the URL in its entirety, which includes the `gid` attribute
   supplied by Google, and not use the `gid` attribute in the shortcode, like this:
 *     ```
       [gdoc key="https://docs.google.com/spreadsheets/d/1Li3u1KRumHqWPvuWFrNYxso0ODRbyDQ3WZlvDYCU2hA/edit#gid=1388495398"]
       ```
   
 * Both of these shortcodes have the same effect. The `gid` attribute in the shortcode
   is specifically for backwards-compatibility with “old” style Google Spreadsheets,
   so you only need to use it if the spreadsheet you’re trying to embed was created
   several years ago.
 *  Thread Starter [behindthebets](https://wordpress.org/support/users/behindthebets/)
 * (@behindthebets)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165260)
 * That makes it even easier. I thought about trying that after I started understanding
   the gid function on Google Spreadsheets a little bit better. Now I don’t even
   have to input the gid= shortcode. I just clone the rows (using Theme X’s Visual
   Composer Backend Editor) and then copy and paste the URLs (from the browser once
   I have clicked on the tab I want to paste) that already include the gid into 
   the gdoc key shortcode.
 * You made such a complicated problem so easy. Your hard work is much appreciated.
   I would gladly have paid a good bit of $ for this kind of plug-in and customer
   service btw. You go beyond what most paid services do. It does not go unnoticed,
   Meitar.
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165276)
 * 🙂 The _point_ of this plugin is to provide a zero-cost alternative to other 
   plugins that are trying to sell you something that should be free in the first
   place. If you have an idea for a feature you think will improve this plugin, 
   or if you see a different for-pay plugin doing something this plugin can’t do,
   let me know so I can write that feature into this plugin. No one should have 
   to pay money to use web services that are free. That’s part of what free software
   _means_.
 * If you like this plugin, feel free to review it positively, click the donate 
   button to help me out personally, and tell your friends about it. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Google spreadsheet embed problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/inline-google-spreadsheet-viewer.
   svg)
 * [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Meitar](https://wordpress.org/support/users/meitar/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/google-spreadsheet-embed-problem/#post-6165276)
 * Status: resolved