{CODICTS} Snippets is now available

WordPress GSheet Connector

The {CODICTS} GSheet Connector plugin enables bi-directional integration between Google Sheets and WordPress. It lets you manage posts and listings directly from a spreadsheet — creating, updating, and deleting WordPress posts by simply editing a Google Sheet.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

Once activated, navigate to “GSheet Connector” in the WordPress admin sidebar to configure your post types and field mappings.


Key Features

FeatureDescription
One-Way Sync (Sheet → WordPress)Editing a Google Sheet automatically creates, updates, or deletes corresponding WordPress posts.
Two-Way Sync (Sheet ↔ WordPress)Optionally sync changes from WordPress back to the connected Google Sheet.
Read-Only ModeView WordPress data in a connected sheet without allowing edits back to WordPress.
Multi-Post-Type SupportConfigure independently for every post type on your site.
Frontend Connection UIA shortcode-based popup lets logged-in users connect their own Google Sheets.
Admin ManagerAdministrators can connect shared sheets that manage posts across all users.
Post LimitsControl how many posts can be created per connected sheet.
Cascade DeleteOptionally delete associated posts when a sheet connection is removed.
Taxonomy SupportImport taxonomy terms from sheet columns with configurable separators.
Image SupportImport images from external URLs — automatically downloaded to the Media Library.
Repeater SupportParse structured multi-value data into Voxel repeater fields.
Post Status ControlSet post status (publish, draft, pending, etc.) from a sheet column.
DeduplicationPosts are tracked by sheet ID + row number to prevent duplicates.
Change DetectionOnly updates posts when actual data changes are detected.

How It Works

The plugin works through a webhook-based system:

1. A user connects a Google Sheet to a WordPress post type (via the frontend popup or admin settings).

2. A small Google Apps Script is installed in the sheet. This script automatically sends the sheet data to your WordPress site whenever the sheet is edited.

3. WordPress receives the data via a webhook, maps each row to a post, and creates new posts or updates existing ones.

4. Any rows that have been removed from the sheet since the last sync are moved to the trash in WordPress.

5. Optionally, with two-way sync enabled, changes made in WordPress are pushed back to the Google Sheet.

Important: The column order in your Google Sheet must match the field order configured in the plugin settings. The first row (headers) is skipped during import.


Admin Settings

Navigate to “GSheet Connector” in the WordPress admin sidebar.

Global Settings

SettingDescription
Enable Two Way SyncMaster toggle for the two-way sync feature. When off, only sheet-to-WordPress sync is available.
Force EnabledWhen on, two-way sync is enabled by default and hidden from the frontend popup.
Enable Read Only OptionShows a read-only toggle in the frontend popup (requires two-way sync).
Enable Admin ManagerAllows designated roles to create shared sheets that manage all posts of a type.
Admin Manager User RolesWhich roles can use the admin manager feature.
Cascade Delete Connected PostsWhen enabled, deleting a sheet connection also permanently deletes all posts created from that sheet.
Taxonomy SeparatorCharacter(s) used to separate multiple taxonomy terms in a single cell (default: ,).
Hide Post Type SelectorHides the post type choice on the frontend popup.
Custom Tutorial VideoURL for a custom tutorial video shown in the frontend popup.

Per-Post-Type Configuration

Below the global settings, each registered post type has its own collapsible configuration section:

1. Enable/Disable — Check the toggle to enable the post type for Google Sheet connections.

2. Post Limit — Set the maximum number of posts that can be created from a single connected sheet. Leave empty for unlimited.

3. Fields Setup — A sortable list of all available fields for the post type. Check the fields you want to include and drag them into the order that matches your Google Sheet columns. The field order here must match the column order in your sheet.

4. Add Custom Fields — Click “Add Custom” to add arbitrary meta field keys that aren’t automatically detected. This is useful for non-Voxel setups or custom meta fields.

Tip: After configuring and saving your fields, use the “Copy Headers” button in the frontend popup to copy the correct column headers for your Google Sheet.


Connecting a Google Sheet

Step 1: Add the Shortcode

Place the shortcode on any page where users should be able to connect their sheets:

[codicts-gsheet-connector]

You can customize the button label:

[codicts-gsheet-connector text="Connect Your Spreadsheet"]

The button only appears for logged-in users.

Step 2: Open the Popup

Clicking the button opens a full-screen connection popup.

Step 3: Select a Post Type

Choose which post type the sheet should create posts for. The post limit (if configured) is shown next to each type.

Step 4: Set Up the Google Sheet

1. Create a Google Sheet. Click the “Copy Headers” button in the popup to copy the correct column headers, then paste them into the first row of your sheet.

2. In the Google Sheet, go to Extensions → Apps Script.

3. Copy the script shown in the popup (click the “Copy” button) and paste it into the Apps Script editor, replacing any existing code.

4. Save the script (Ctrl+S).

For one-way sync: Set up an installable trigger. In the Apps Script editor, click the clock icon (Triggers), then add a trigger for the onEdit function with the event type “On edit”.

For two-way sync: You also need to deploy the script as a web app. Click Deploy → New deployment → Web app. Set “Execute as” to your account and “Who has access” to “Anyone”. Copy the deployment URL and paste it into the “Web App URL” field in the popup.

Step 5: Paste the Sheet URL

Copy the URL of your Google Sheet from the browser address bar and paste it into the “Google Sheet URL” field in the popup.

Step 6: Save the Connection

Click “Save Connection”. The sheet now appears in the Connected Sheets panel on the right side of the popup.

Start adding data to your sheet — each row (after the header) creates a WordPress post.


Special Field Types

Taxonomy Fields

When a column is mapped to a taxonomy field, the cell value is split into individual terms using the configured separator (default: comma). Each term is assigned to the post automatically.

Sheet Cell ValueSeparatorResult
Pizza, Burgers, Sushi,Three terms assigned: Pizza, Burgers, Sushi
New York%&%Los Angeles%&%Two terms assigned: New York, Los Angeles

If a term doesn’t exist yet, it’s created automatically. Change the separator in admin settings if your term names contain commas.

Image Fields

Enter image URLs in the cell. For multiple images, separate URLs with commas. The plugin automatically downloads each image to your WordPress Media Library and links it to the post.

Supported formats: JPEG, PNG, GIF, and WebP. Images are only downloaded once — if the same URL appears again, the existing Media Library attachment is reused.

Repeater Fields (Voxel Only)

For Voxel repeater fields, format data in a single cell using this pattern:

value1|value2, value1|value2, value1|value2

The pipe (|) separates sub-field values within a single repeater row. Commas separate multiple repeater rows. Sub-fields are matched to the repeater’s defined fields in order.

Example: For a repeater with sub-fields “name” and “price”:

Sheet Cell ValueResult
Pizza|12.99, Burger|9.99, Sushi|15.99Three repeater rows: Pizza ($12.99), Burger ($9.99), Sushi ($15.99)

Post Status Field

If a column is mapped to post_status, you can control the post status directly from the sheet. Valid values include publish, draft, pending, private, and any custom registered post status (must be lowercase).


Two-Way Sync

Two-way sync pushes WordPress post data back to the connected Google Sheet. When enabled, editing a post in WordPress triggers a sync that updates the sheet to reflect the current data.

Setup

1. Enable “Enable Two Way Sync” in the admin settings.

2. When connecting a sheet in the frontend popup, toggle “Two Way Sync” on.

3. Deploy the Apps Script as a web app (see Step 4 above) and paste the web app URL into the popup.

How It Works

When a post is saved in WordPress (either from the admin or frontend), the plugin schedules a sync. It contacts the Google Apps Script web app, which then fetches the latest data from WordPress and updates the sheet. The sync is debounced — if multiple posts are saved rapidly, only one sync runs.

Note: The plugin temporarily disables the sync during webhook imports to prevent infinite loops (sheet edits WordPress → WordPress syncs back to sheet → sheet edits WordPress again).


Read-Only Mode

Read-only mode is available when two-way sync is enabled. A read-only connection pushes WordPress data to the sheet, but the sheet cannot push data back to WordPress.

This is useful when you want a live spreadsheet view of your WordPress data without the risk of accidental edits from the sheet side.

To enable, turn on “Enable Read Only Option” in admin settings, then toggle “Read Only Mode” when connecting a sheet in the frontend popup.


Admin Manager (Shared Sheets)

By default, each user’s connected sheet only manages posts they own. The Admin Manager feature lets designated roles connect shared sheets that manage all posts of a type, regardless of author.

Setup

1. Enable “Enable Admin Manager” in admin settings.

2. Select which user roles have admin manager access.

3. When connecting a sheet, users with allowed roles see an “Enable Admin Manager” toggle in the popup.

Differences from Regular Connections

AspectRegularAdmin Manager
ScopeOnly the connecting user’s postsAll posts of the connected type
Post limitEnforcedDisabled
Cascade deleteApplies when enabledExempt
VisibilityOnly the connecting userAll users with admin manager roles

Post Limits & Cascade Delete

Post Limits

Each post type can have an optional maximum number of posts per connected sheet. When the limit is reached, remaining rows in the sheet are ignored. The limit is shown to users in the frontend popup next to the post type name. Admin manager sheets bypass post limits.

Cascade Delete

When “Cascade Delete Connected Posts” is enabled in settings, deleting a sheet connection also permanently deletes all WordPress posts that were created from that sheet. Admin manager and read-only connections are exempt from cascade delete.

Separate from cascade delete: During every webhook sync, any posts that no longer have a corresponding row in the sheet are automatically moved to the trash (not permanently deleted). This keeps your posts in sync with the sheet contents.


Voxel Theme Integration

The plugin works with any WordPress theme, but provides enhanced features when the Voxel Theme is active:

FeatureWith VoxelWithout Voxel
Post type discoveryAll Voxel post types detected automaticallyPublic custom post types detected
Field discoveryAll Voxel fields with labels and typesMeta keys from existing posts
Taxonomy fieldsAutomatically detected and handledNot auto-detected (use custom fields)
Image fieldsAutomatically detected with download/importNot auto-detected (use custom fields)
Repeater fieldsFull support with sub-field mappingNot supported

When using a non-Voxel theme, make sure you have at least one existing post of each type so the plugin can discover the available meta fields.


Managing Connected Sheets

The Connected Sheets panel in the frontend popup shows all your active connections. For each connection you can:

Sync — Manually trigger a two-way sync (pushes current WordPress data to the sheet).

Delete — Remove the connection. If cascade delete is enabled, associated posts are also permanently deleted.

Administrators can also see and manage all connections from the right column of the admin settings page.


Google Apps Script Reference

One-Way Sync Script

This script sends sheet data to WordPress whenever the sheet is edited:

function onEdit(e) {
  UrlFetchApp.fetch('https://your-site.com/?cgsc-webhook', {
    method: 'POST',
    contentType: 'application/json',
    payload: JSON.stringify({
      sheetId: e.source.getId(),
      data: e.source.getActiveSheet().getDataRange().getValues()
    })
  });
}

Replace https://your-site.com with your actual site URL. Set this up as an installable trigger (not a simple trigger) in the Apps Script editor.

Two-Way Sync Script

This extended script adds a doGet function so WordPress can push data back to the sheet. The full script is provided in the frontend popup when two-way sync is enabled — copy it from there to ensure it contains your correct site URL.

After pasting the two-way script, deploy it as a Web App:

1. In the Apps Script editor, click Deploy → New deployment.

2. Select Web app as the type.

3. Set “Execute as” to your Google account.

4. Set “Who has access” to “Anyone”.

5. Click Deploy and copy the web app URL.

6. Paste the URL into the “Web App URL” field when saving your connection.


Troubleshooting

Posts Not Being Created from the Sheet

CauseSolution
Post type not enabledGo to admin settings and enable the post type.
No fields configuredCheck the fields setup for the post type and ensure at least some fields are checked.
Column order mismatchThe column order in your Google Sheet must match the field order in the plugin settings exactly.
Post limit reachedIncrease or remove the post limit in the admin settings.
Webhook not installedEnsure the Apps Script is installed in the sheet and set up with an installable trigger.
Read-only mode enabledDisable read-only mode on the connection to allow imports from the sheet.
Empty rowsRows with no data are skipped automatically.

Two-Way Sync Not Working

CauseSolution
Two-way sync not enabledEnable “Enable Two Way Sync” in the admin settings.
Script not deployed as web appThe Apps Script must be deployed as a web app. See the Apps Script reference.
Invalid web app URLThe URL must match the format https://script.google.com/macros/s/.../exec.
Permissions issueEnsure the web app is set to “Execute as me” with “Anyone” access.
WP-Cron not runningTwo-way sync uses WP-Cron. If DISABLE_WP_CRON is set to true, set up a server-side cron job.

Images Not Importing

CauseSolution
URL not accessibleEnsure the image URL is publicly accessible (not behind a login).
Unsupported formatOnly JPEG, PNG, GIF, and WebP are supported.
Server timeoutVery large images may time out during download. Try smaller files or increase your server’s timeout.

Taxonomy Terms Not Being Assigned

CauseSolution
Wrong separatorEnsure the separator in admin settings matches what you’re using in the sheet (default is comma).
Field not detected as taxonomyThis requires the Voxel Theme for automatic detection. For non-Voxel sites, taxonomy fields must be handled as custom meta.

Duplicate Sheet Connection Error

Each Google Sheet can only be connected once, and each Apps Script web app URL can only be used once. If you need to reconnect a sheet, delete the existing connection first.

“No Available Post Type” in the Frontend Popup

Ensure at least one post type is enabled with fields configured in the admin settings, and that settings have been saved.

Fields Not Appearing in Admin Settings

For Voxel sites, ensure the post type has fields defined in Voxel’s post type editor. For non-Voxel sites, the plugin reads fields from existing posts — create at least one post of the type so meta keys can be discovered.


For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved