How to import tables from Google Sheets

TablePress can import tables from a variety of popular spreadsheet applications. This includes XLSX files from Microsoft Excel, CSV (Character-Separated Values), ODS (OpenDocument Spreadsheet), HTML, and JSON files. In addition to uploading files from your local computer, it is also possible to import spreadsheets into your WordPress site by providing a URL (link address) to such a file.

This opens up the possibility to import a table from a Google Sheets table into TablePress. (By the way: The TablePress Max license plan comes with the Automatic Periodic Table Import feature. This allows you to fully automate the table import process, saving you time and effort!)

All that you need for this is a link address to the spreadsheet that directly returns an appropriate file, without any user interface or login screen. This can be done by publicly sharing the Google Sheet and then using a generated (secret) URL for the import into TablePress. Our beginner-friendly step-by-step tutorial will guide you through this process and show you how to find this URL for your Google Sheets table.

Step 1: Open your Google Sheet

Go to the Google Sheets website and sign in to your Google account, if you are not yet logged in. Create a new spreadsheet or open an existing one that contains the table you want to share.

Step 2: Share the Spreadsheet

Click the “File” menu (1), choose “Share” (2), and click “Share with others” (3). Alternatively, click on the “Share” button in the top-right corner of the screen, if that’s shown.

Opening the "Share with others" dialog in Google Sheets.
Opening the “Share with others” dialog in Google Sheets.

In the “Share” dialog, click on the “Restricted” (1) dropdown menu next to the lock icon. Choose “Anyone with the link” (2) from the dropdown menu. The access level in the Permissions dropdown on the right should be left as “Viewer”.

Sharing a Google Sheet to "Anyone with the link".
Sharing a Google Sheet to “Anyone with the link”.

After configuring the sharing settings, click the “Copy link” button (1) in the bottom-left corner of the dialog. You will now have the Sharing link for the Google Sheets user interface in your computer’s clipboard.

Copying the Sharing link address from the "Share" dialog of Google Sheets.
Copying the Sharing link address from the “Share” dialog of Google Sheets.

Step 3: Obtaining the Sharing URL

Open a new browser tab and paste the copied link into the address bar. The link looks like

https://docs.google.com/spreadsheets/d/{spreadsheet-id}/edit?usp=sharingCode language: HTML, XML (xml)

where {spreadsheet-id} is an ID of your sheet, consisting of a long sequence of letters and numbers.

Now, choose the desired data transfer format that you want to use, between xlsx and csv:

  • If your Google Sheet contains basic formatting (like text or numbers in boldface, italics, or with text colors) or clickable links, choose the xlsx format (Microsoft Excel).
  • If your Google Sheet does not contain formatted data (or if you don’t want that format to be imported or if the import then produces undesired results), choose the csv format (Character-separated Values). The csv format is usually more reliable.

The chosen format then has to be added to the copied Sharing URL. For that, in the address bar, replace the /edit?usp=sharing at the end

The Editing URL "https://docs.google.com/spreadsheets/d/{spreadsheet-id}/edit?usp=sharing" for a Google Sheet in the browser address bar, with /edit?usp=sharing at the end.

with /export?format=xlsx or /export?format=csv (depending on the chosen format), like this:

The Sharing URL "https://docs.google.com/spreadsheets/d/{spreadsheet-id}/export?format=csv" for a Google Sheet in the browser address bar, with /export?format=csv at the end.

Copy that modified URL, which now looks like

https://docs.google.com/spreadsheets/d/{spreadsheet-id}/export?format=xlsxCode language: HTML, XML (xml)

for the xlsx format or like

https://docs.google.com/spreadsheets/d/{spreadsheet-id}/export?format=csvCode language: HTML, XML (xml)

for the csv format.

That’s it! You now have a link address that can be used for importing the Google Sheets table into TablePress.

A quick tip: To check if a URL link is suitable, try opening it in a “private”/”incognito” browsing window. If you are offered an xlsx or csv file for download, without seeing a spreadsheet user interface or having to log in first, the URL should work for the import into TablePress.

Step 4: Selecting a different worksheet (optional)

By default, the generated link address from above will return the first worksheet of a Google Sheets workbook. Sometimes, a Google Sheet workbook might contain more than one sheet:

Selecting a different worksheet from a Google Sheet workbook with multiple sheets.
Selecting a different worksheet from a Google Sheet workbook with multiple sheets.

If you would like to import a different worksheet, you will have to find its gid identifier. This is shown at the very end of the browser address bar when that worksheet is open and looks like /edit#gid=1234567890 with some very long number.

The Editing URL "https://docs.google.com/spreadsheets/d/{spreadsheet-id}/edit#gid={gid}" for a Google Sheet in the browser address bar, with /edit#gid=1234567890 at the end.

Copy the gid=1234567890 part and append it, separated by an ampersand &, to the Sharing URL from Step 3 (either with xlsx or csv as the format):

https://docs.google.com/spreadsheets/d/{spreadsheet-id}/export?format=csv&gid={gid}Code language: HTML, XML (xml)

This extended Sharing address will now directly return the desired worksheet of that Google Sheets file.

Step 5: Import the URL into TablePress

Once you have the correct Sharing URL from Step 3 (or Step 4, if you would like a specific worksheet), you can use that for importing the Google Sheet into TablePress. For that, go to the “Edit” screen of TablePress on your WordPress site. Choose “URL” as the “Import Source” and paste the URL into the “File URL” text field. After clicking the “Import” button, your Google Sheets table will be imported into TablePress. You can then edit it as needed and show it on your site by embedding the “TablePress table” block (if you are using the block editor) or the corresponding Shortcode into a post or page.

Importing a TablePress table from the generated Sharing URL of a Google Sheet.
Importing a TablePress table from the generated Sharing URL of a Google Sheet.

By the way: This process also works with files uploaded to Google Drive! To open the Sharing dialog, just right-click on the file in Google Drive and find the “Share” entry. Then, follow the steps above.

Tutorials on how to create such a URL for other services like Microsoft Excel Online, Microsoft OneDrive, or Dropbox are available on the Tutorials, Guides, and How-tos page.


Another remark: Google Sheets also offers a “Publish to Web” feature that can be used to create similar Sharing URLs, that look like

https://docs.google.com/spreadsheets/d/e/2PACX-{workbook-ID}/pub?gid={sheet-ID}&single=true&output=csvCode language: HTML, XML (xml)

However, we do not recommend using this “Publish to Web” feature to import tables into TablePress! The generated URLs will work, in general. However, they tend to load much slower than the URLs generated via the regular “Share” feature that is described in the steps above. This increases the risk of timeout errors, especially when multiple imports are run.