# Getting Started

This guide will help you quickly set up SheetPoet and start exchanging data between Google Sheets and WordPress.

Also, you can follow the video tutorial

🚀 A Video Tutorial of full walkthrough
../tutorial/

# Installation Overview

SheetPoet consists of two components that need to be installed:

  1. WordPress Plugin: Installed on your WordPress site
  2. Google Sheets Add-on: Installed in Google Sheets

# Step 1: Install the WordPress Plugin

  1. Log in to your WordPress admin dashboard
  2. Go to Plugins > Add New
  3. In the search box, type "SheetPoet"
  4. Find "SheetPoet" in the search results
  5. Click Install Now
  6. After installation, click Activate Plugin

Alternative: You can also download the plugin ZIP file and upload it manually via Plugins > Add New > Upload Plugin.

# Step 2: Generate an API Key

  1. In WordPress, go to SheetPoet > Settings
  2. In the API Keys section, click Generate New API Key
  3. Enter a name for your key (e.g., "Google Sheets Connection")
  4. Click Generate
  5. Copy the generated API key (you'll need it for the Google Sheets Add-on)

# Step 3: Create Your First Function

  1. In WordPress, go to SheetPoet > Functions
  2. Click Add New Function
  3. Choose "Import to Sheet" or any other type as the function type
  4. Enter "Get Recent Posts" as the display label
  5. Paste this example code:
function sp_get_recent_posts($record) {
    $index = isset($record['index']) ? intval($record['index']) : 0;
    $batch_size = isset($record['batchSize']) ? intval($record['batchSize']) : 10;
    $offset = $index * $batch_size;

    $args = [
        'post_type'      => 'post',
        'posts_per_page' => $batch_size,
        'offset'         => $offset,
        'post_status'    => 'publish',
    ];

    $query = new WP_Query($args);
    $posts = [];

    if ($query->have_posts()) {
        foreach ($query->posts as $post) {
            $posts[] = [
                'ID'    => $post->ID,
                'title' => get_the_title($post),
                'link'  => get_permalink($post),
            ];
        }
    }

    return $posts;
}
  1. Click Validate Function to check for errors
  2. Click Save Function

# Step 4: Install the Google Sheets Add-on

  1. Open Google Sheets in your browser
  2. Click Extensions > Add-ons > Get add-ons
  3. Search for "SheetPoet" in the Google Workspace Marketplace
  4. Click on SheetPoet and then Install
  5. Grant the necessary permissions when prompted

# Step 5: Connect to WordPress

  1. In Google Sheets, click Extensions > SheetPoet - WordPress Connector > Manage Credentials
  2. Click Add New Credential
  3. Enter:
    • Name: A friendly name for your site
    • Server Root URL: Your WordPress site URL (e.g., https://example.com)
    • Username: Your WordPress username
    • Password: Your API key you copied earlier from Step 2
  4. Click Save
  5. Open the SheetPoet sidebar: Extensions > SheetPoet - WordPress Connector > Operations > Import data to sheet
  6. Select the WordPress site you just added
  7. Select the Sheet in which you want to import the data. All the data will be read and saved in this sheet.
  8. In the Function dropdown, select the "Get Recent Posts" function you created earlier
  9. Add the Magic Parameters which are key value pairs your function will have access to. In this case, if you add test as the key and 1 as the value, the function can access it as $record['test'] and it will have the value of 1. Default parameters like index, processed, and batchSize are automatically added for Import to Sheet functions and you can use them in your function.
  10. Choose the batch size. This is the number of rows that will be fetched in each API call.
  11. Click Process
  12. Your WordPress posts will start appearing in the spreadsheet
  13. You can stop the process at any time by clicking Stop.

# Next Steps

Now that you have the basic setup working, you can:

  1. Create more advanced functions in WordPress
  2. Learn about different operations in Google Sheets
  3. Save common operations as presets
  4. Check the execution history in WordPress

# Troubleshooting

If you encounter any issues during setup:

  • Verify your WordPress site is accessible from the internet
  • Check that your API key is correct
  • Ensure your function syntax is valid
  • See our Troubleshooting Guide for more help