SheetMirror for Google Sheets

Description

SheetMirror embeds a live Google Sheets spreadsheet into any WordPress post or page using a simple shortcode. Unlike basic CSV importers, SheetMirror can connect to the Google Sheets API v4 to retrieve not just your data, but the full visual formatting of every cell – giving your readers a table that looks exactly like the one you designed in Google Sheets.

Why SheetMirror ?

Spreadsheet data on the web is often reduced to a bland, unstyled grid. The formatting you spent time on – the bold headers, the colour-coded rows, the carefully aligned columns – disappears entirely. SheetMirror solves this by faithfully translating your Google Sheets formatting into standard HTML and inline CSS, so the table your readers see on your site is a true reflection of the original.

Two Fetch Modes

API Mode (recommended)
Uses the Google Sheets API v4 to retrieve both cell values and full formatting metadata. A Google Cloud API key is required. This is the mode that enables all the rich formatting features described below.

CSV Mode (no API key needed)
Fetches data via Google’s public CSV export URL. No API key or account is required – just share your sheet as “Anyone with the link can view.” Cell values are displayed in a clean, readable table, without formatting. Ideal for simple data tables where styling is not a priority.

Formatting Reproduced via the API

When API Mode is enabled, SheetMirror retrieves and applies the following formatting properties from your spreadsheet:

  • Horizontal alignment – Left, Centre, Right, and Justify, applied per cell.
  • Vertical alignment – Top, Middle, and Bottom.
  • Text decoration – Bold (<strong>), italic (<em>), underline (<u>), and strikethrough (<s>) are each rendered using the appropriate semantic HTML element.
  • Font family – The typeface specified in the spreadsheet is passed through as a CSS font-family value.
  • Font size – Rendered as pt values, matching the size as set in Google Sheets.
  • Font colour – Foreground text colour is reproduced as a CSS color value.
  • Cell background colour – Background fill colours are rendered as CSS background-color values. White and black (the default colours) are suppressed to avoid overriding your theme’s own styling.
  • Merged cells – Merge regions are faithfully reproduced using HTML rowspan and colspan attributes.
  • Cell borders – Per-cell border styles (solid, dashed, dotted, double) and weights (1 px, 2 px, 3 px) are applied as individual CSS border-{side} declarations.
  • Text wrap strategy – Wrap and Clip modes are translated to the appropriate CSS white-space and overflow rules. The Overflow mode (content spilling into adjacent cells) is a layout behaviour specific to Google Sheets and cannot be reproduced in an HTML table.
  • Text direction – Right-to-left text is reproduced with CSS direction: rtl.
  • Hyperlinks – Both cell-level hyperlinks and links set via the Google Sheets link format are rendered as <a> tags with target="_blank" rel="noopener noreferrer".
  • Column widths – Each column’s pixel width is retrieved from the spreadsheet and applied via <colgroup> elements, reproducing the exact column proportions of the original. Active when the “Auto column width” option is off (the default).
  • Row heights – Each row’s pixel height is retrieved and applied as an inline height style on the <tr> element, preserving the vertical spacing of the original spreadsheet. Active when the “Auto column width” option is off (the default).

Table Display Options

Each registered table can be configured independently with the following options:

  • Use Google Sheets API – Toggle between API Mode (full formatting) and CSV Mode (values only).
  • Treat first row as header – Renders the first row inside a <thead> element using <th> cells with scope="col", improving accessibility and allowing header-specific styling.
  • Auto column width – When off (default), column widths are taken directly from the spreadsheet’s pixel dimensions via the API, reproducing the layout as designed in Google Sheets. When on, each column shrinks to fit its content (table-layout: auto). The “Auto” badge is shown in the table list only when this option is enabled.
  • Borderless – Hides all cell borders for a cleaner, minimal presentation. When off, a standard 1 px grid is shown as a fallback, with per-cell API borders taking priority where available.

Caching

All API and CSV responses are cached using WordPress transients for 5 minutes, keeping your page loads fast and your API quota usage low. A “Clear Cache” button is available for every registered table so you can force a refresh immediately after updating your spreadsheet.

Shortcode Usage

After registering a table in Settings SheetMirror, embed it anywhere using its tag name as a shortcode:

[your_tag_name]

For example, if you registered a table with the tag sales_2026, place [sales_2026] in any post, page, or widget area.

Scaling the table

An optional scale attribute lets you render the table at a percentage of its original size. Accepted values are integers between 10 and 200.

[sales_2026 scale="50"]

Requirements

  • A Google Sheets spreadsheet shared as “Anyone with the link can view.”
  • For API Mode: a Google Cloud API key with the Google Sheets API enabled.

External Services

This plugin connects to external services operated by Google. Depending on the fetch mode you choose, one or both of the following connections will be made.

Google Sheets API v4 (API Mode)

When API Mode is enabled, this plugin sends requests to the Google Sheets API v4 to retrieve cell values and formatting metadata from your spreadsheet.

  • Service: Google Sheets API v4, provided by Google LLC.
  • Data sent: The Spreadsheet ID and cell range you registered, together with your Google Cloud API key. No personal data of your site’s visitors is transmitted.
  • When: Every time a page containing the shortcode is loaded and no valid cached response exists (cache duration: 5 minutes). A request is also made when you use the connection-test button in the settings page.
  • Terms of Service: https://developers.google.com/terms
  • Privacy Policy: https://policies.google.com/privacy

Google Sheets CSV Export (CSV Mode)

When CSV Mode is enabled, this plugin fetches data from Google’s public CSV export URL for your spreadsheet.

  • Service: Google Sheets public CSV export (/export?format=csv), provided by Google LLC.
  • Data sent: The Spreadsheet ID and numeric sheet identifier (gid). No API key or visitor data is transmitted.
  • When: Every time a page containing the shortcode is loaded and no valid cached response exists (cache duration: 5 minutes).
  • Terms of Service: https://policies.google.com/terms
  • Privacy Policy: https://policies.google.com/privacy

Google Sheets Sheet List (CSV Mode – sheet name resolution)

When CSV Mode is enabled and a sheet name is specified in the cell range, this plugin fetches the spreadsheet’s HTML view page in order to resolve the sheet name to its numeric identifier (gid). This request is made once per spreadsheet and the result is cached together with the table data.

  • Service: Google Sheets HTML view page (/htmlview), provided by Google LLC.
  • Data sent: The Spreadsheet ID only. No API key or visitor data is transmitted.
  • When: On the first load of a page containing a CSV Mode shortcode that specifies a sheet name, when no valid cached response exists. Not used when a gid is available directly from the registered URL, or when API Mode is enabled.
  • Terms of Service: https://policies.google.com/terms
  • Privacy Policy: https://policies.google.com/privacy

Donate

If you find this plugin useful and would like to support its development,
you can make a voluntary donation via PayPal.

Your support helps keep this plugin maintained and improved.
Thank you!

PayPal: https://www.paypal.me/Kasuga16

Screenshots

  • Step 1: Format your Google spreadsheet (colors, fonts, and merged cells).
  • Step 2: Register tables and manage your API key in the SheetMirror settings.
  • Step 3: Insert the [shortcode] into any page or post.
  • Step 4: View your spreadsheet faithfully rendered as an HTML table.

Installation

  1. In your WordPress admin dashboard, go to Plugins Add New.
  2. Click Upload Plugin, choose the sheetmirror-for-google-sheets.zip file, and click Install Now.
  3. After installation, click Activate Plugin.
  4. Navigate to Settings SheetMirror.
  5. (API Mode only) Enter your Google Cloud API key and click Save.
  6. Click Register New Table, fill in the tag name, spreadsheet URL, and cell range, then click Register.
  7. Place the shortcode [your_tag_name] in any post or page.
     

Getting a Google Cloud API Key

  1. Open the Google Cloud Console.
  2. Create a new project (or select an existing one).
  3. Go to APIs & Services Library and enable the Google Sheets API.
  4. Go to APIs & Services Credentials and click Create Credentials API Key.
  5. Copy the key and paste it into Settings SheetMirror API Key.

For security, it is recommended to restrict your API key to the Google Sheets API and to your site’s server IP address in the Google Cloud Console.

FAQ

Do I need an API key to use this plugin?

No. CSV Mode works without any API key – just share your spreadsheet as “Anyone with the link can view” and register the table with the “Use Google Sheets API” option turned off. Cell values will be displayed without formatting.

Why does my table look different from the one in Google Sheets?

SheetMirror reproduces all formatting that is exposed by the Google Sheets API v4. Some visual elements – such as conditional formatting rules and sparklines – are not part of the cell-level formatting data returned by the API and therefore cannot be replicated.

Also note that font families specified in your spreadsheet may not be available on your visitors’ devices. In that case the browser will fall back to the sans-serif system font.

Can I register more than one table?

Yes. You can register as many tables as you like, each with its own tag, URL, range, and display options. Every table gets its own shortcode.

What cell range format should I use?

Standard A1 notation is supported. Examples:

  • A1:D10 – a range on the default sheet
  • Sheet1!B2:E20 – a range on a named sheet

Is the plugin compatible with the Block Editor (Gutenberg)?

Yes. Place the shortcode inside a Shortcode block, or use it in the Classic block. The table will render on the front end exactly as configured.

My spreadsheet contains sensitive data. Is it safe to use CSV Mode?

CSV Mode fetches data from Google’s public export URL, which means anyone with the spreadsheet URL can view the data. Only use CSV Mode (or API Mode) with spreadsheets you are comfortable making publicly readable. Always use the “Anyone with the link can view” sharing permission rather than “Public on the web” where possible.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“SheetMirror for Google Sheets” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release.
  • Added optional scale shortcode attribute (10–200) to resize a table without affecting the surrounding page layout.
  • API Mode: full cell formatting via Google Sheets API v4.
  • CSV Mode: value-only fetch with no API key required.
  • Supports alignment, text decoration, font family/size, colours, merged cells, borders, text wrap (Wrap & Clip), RTL text, and hyperlinks.
  • Per-table options: header row, auto/fixed column width, borderless mode.
  • Column widths and row heights reproduced from spreadsheet pixel dimensions in fixed (default) mode.
  • WordPress transient caching with manual clear-cache button.
  • AJAX connection test for API key and range validation.
  • Live shortcode tag preview in the registration form.