Google Sheets Dynamic Tags
WordPress plugin: display live dynamic content (text, prices, images) from Google Sheets via shortcode — no admin panel needed.
by Lounes G · github.com/lnshady/balises-dynamiques-google-sheets-v1- · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/lnshady/balises-dynamiques-google-sheets-v1-/archive/refs/heads/main.zipReadme
Google Sheets Dynamic Tags (V3)
An ultra-lightweight WordPress plugin to synchronize and display dynamic data (text, prices, images) from a published Google Sheets CSV — using a single shortcode. No admin panel, no API key, no iframe.
Perfect for: restaurant daily menus, hotel rates, event schedules, product prices, or any content that changes often and should be edited in Google Sheets, not WordPress.
Features
- Zero config — publish your Google Sheet as CSV, paste the URL in one constant, done.
- Cell-level shortcodes —
[menu row="2" col="3"]fetches exactly one cell, not an entire table. - Smart cache — uses WordPress transients with time-slice rotation to prevent cache stampede.
- Image support —
type="image"renders an<img>tag from a URL in the cell. - Cache-busting — bypasses Google's CDN/proxy cache for fresh data every time.
- 3-second timeout — your page won't hang if the sheet is unreachable.
Usage
Basic text cell
[menu row="2" col="3"]
Image cell (cell contains an image URL)
[menu row="1" col="4" type="image"]
With fallback and custom cache
[menu row="5" col="2" type="text" default="Prix non disponible" cache="120"]
Available attributes
| Attribute | Default | Description |
|---|---|---|
row |
1 |
Row index (1-based) |
col |
1 |
Column index (1-based) |
type |
text |
text or image/img |
default |
— |
Fallback display if cell is empty or fails |
cache |
60 |
Cache duration in seconds |
Configuration
Open google-sheets-dynamic-tags.php and replace the URL constant:
define('GSHEETS_CSV_URL', 'https://docs.google.com/spreadsheets/d/.../pub?output=csv');
How to get your CSV URL:
- Open your Google Sheet
- File → Share → Publish to web
- In the popup, choose "Comma-separated values (.csv)"
- Copy the generated link and paste it into the constant above
Requirements
- WordPress 5.0+
- PHP 7.4+
Installation
- Upload
google-sheets-dynamic-tags.phpto/wp-content/plugins/google-sheets-dynamic-tags/ - Activate the plugin from Plugins screen
- Set your Google Sheets CSV URL in the plugin file
- Use
[menu ...]in any post, page, or widget
License
MIT © 2026 Lounes G