Skip to content

How to Import Data From Google Sheets in WordPress Table?

Key Takeaways

  • The Nexter Blocks Data Table block imports data from Google Sheets into a WordPress table by selecting Google Sheet in the Type section.
  • Google API Key setup requires Google Developers Console, enabling Google Sheets API, and creating an API Key under Credentials.
  • The Data Table block needs three inputs for the import: API Key, Sheet ID from the spreadsheet URL, and Table Range from Data > Named ranges.
Table of Contents

When the real data lives in a Google Sheet, copying it into your site means doing the job twice every time it changes.

The Data Table block can read the sheet directly, so the table follows whatever is in the spreadsheet.

For every Data Table setting in one place, see the Data Table block guide.

Before You Start

  • Edition: Pro — Google Sheet import needs Nexter Blocks Pro.
  • Block to enable: Data Table, switched on under Nexter > Blocks in your WordPress dashboard.
  • A Google Sheet anyone can read: share it so that anyone with the link can view, or the request will be refused.
  • A Google Sheets API key from the Google Cloud console, with the Google Sheets API enabled for that project.

Steps

  1. Add the Data Table block to your page and click Design from Scratch.
  1. In the Table panel, set Type to Google Sheet.
The Table panel with Type set to Google Sheet
  1. Paste your key into API Key.
  1. Put the sheet’s ID into Sheet ID — it is the long string in the sheet’s own URL between /d/ and /edit.
The Sheet ID field in the Table panel
  1. Set Table Range to the tab and cells to read, in the form Sheet1!A1:C18.
The Table Range field with its example format
  1. Publish the page.

The Three Fields

FieldWhere it comes from
API KeyA Google Cloud project with the Google Sheets API enabled
Sheet IDThe part of the sheet’s URL between /d/ and /edit
Table RangeThe tab name, an exclamation mark, then the cell range — for example Sheet1!A1:C18

All three are needed together. The block only asks Google for the data once the API key, the Sheet ID and the range are all filled in.

How It Behaves

  • The first row of the range becomes the heading row, and the rest become data rows.
  • The range decides exactly which cells are used, so a sheet with notes off to one side can still be imported cleanly by narrowing the range.
  • The Table Header and Table Body panels are hidden under this Type, since the rows come from the sheet.
  • The sheet is read with your API key, so the sheet has to be readable without signing in.

Limitations

  • Pro only.
  • The sheet must be shared so that anyone with the link can view it. A private sheet cannot be read with an API key alone.
  • Google applies its own quotas to the Sheets API, so a very busy page can hit request limits.
  • The range is fixed, so rows added past the end of it will not appear until you widen the range.
  • Cells arrive as plain text — buttons, links and images have to come from a Standard table.

Troubleshooting

The table stays empty

Work through all three fields. The most common causes are a sheet that is not shared for public viewing, a project where the Google Sheets API has not been enabled, and a range naming a tab that does not exist.

Only part of the sheet appears

Widen Table Range. It reads exactly the cells you name and nothing outside them.

The wrong tab is showing

The part before the exclamation mark is the tab name, and it must match the tab exactly, including spaces.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!