How to Automatically Send Post & Page Data from WordPress to Airtable

Automatically getting post and page data such as; author, title, word count, category etc. sent from WordPress to Airtable can prove incredibly useful as part of a content workflow process. So let me show you how to do just that.

WordPress to Airtable Summary

What we are going to do is use my free plugin for WordPress called Post Webhook to automatically send data to Airtable when we publish or delete a post or page. I’ll show you how to handle the data once it’s in Airtable and some examples of the powerful things you can do with the information.

The data we are going to receive is; Author (display name), Post ID, Post Title, Post Date, Post Modified Date, Post GUID, Post Slug, Permalink, Post Type, Post Status, Post Categories, Post Tags and Post Word Count.

You don’t need to use all of these data items, just ignore the ones you don’t want.

Airtable Plan Limits & Screwed Up Pricing Model

Before we get into this article, if you are new to Airtable, I just want to mention how Airtables plan limits and pricing works because if you have a large team of writers you want to share your ‘Base’ with it may not be the solution for you.

On the Free plan there is a limit of 5 users, 1,200 records (rows in your tables) per Base and 100 automation runs per month per Workspace. So in the context of this article, that’s 1200 posts in total and 100 Webhook ‘events’ per month. This will be OK for a lot of people and the 1st tier in the paid plan is only $10 per month and gives you 5,000 records and 5,000 automation runs per month.

All good so far but here’s where the Airtable pricing model can be problematic (and insane if you ask me, because I’d imagine a lot of valuable mid-large customers leave Airtable because of it).

If you have a team of writers and you want them to have more than just read only access, then be aware that if you need a paid plan because you need more than 1,200 records or 100 automation runs p/m then you will have to pay for each user. So if you have 5 writers + 1 VA + You, that will run you a minimum of $70 per month, even though those writers will probably only have access to one view and do nothing more than change the status of an article they are writing.

Anyway, now you are aware of the weird pricing model and you can make an informed choice about whether Airtable is right for you, let’s carry on with what we came here for.

Step 1 – Create a Table in Airtable

If you don’t already have an Airtable account, go and open one. Everything we are about to do can be done in the free plan (but be mindful of what I mentioned above).

  • Create a new table in Airtable, which I’ll call ‘WordPress Posts’
  • Create your columns and field types, mine are:
Column NameField Type
SlugSingle line text
Post GUIDSingle line text
Post IDNumber (Integer format)
Posted DateDate (with include time selected)
Updated DateDate (with include time selected)
LinkURL
TitleSingle line text
AuthorSingle line text
CategoriesSingle line text
Word CountNumber (Integer format)
Post StatusSingle line text
Post TypeSingle line text
Website Content Worklfow WordPress Posts Table

It’s probably worth explaining one of those that you may not have come across before, namely Post GUID.

The Post GUID looks like this https://jonathan-wright.com/?p=262 and it’s a combination of your domain name and your Post ID. WordPress generates automatically in the background for every post and page on your site.

The reason I included it in the plugin is because it is always unique even if you have multiple blogs (Post ID, is not unique across multiple blogs). If you only have one blog, you can use Post ID instead if you wish.

It’s also worth pointing out that I have ‘Slug’ as my first and therefore primary field (a Slug is the text that comes at the end of your URL/Permalink e.g. ‘wordpress-to-airtable’ is the slug of this post). This is deliberate because I want to use that field as my linked field (which I’ll explain later in the article). You don’t have to do the same, you could use Title or Link, basically any other field that is easily searchable to identify a specific post.

Step 2 – Get your Webhook URL

  • Within Airtable, select the Automations tab in the main navigation
  • Click Add trigger and select When webhook received trigger
Airtable Automations 1
  • Copy the URL that Airtable gives you
Airtable Automations 2

Step 3 – Install the Plugin in WordPress

  • Go to your WordPress site and log in to your Admin area
  • Go to Plugins > Add new and search for my plugin, which is called Post Webhook (or directly from the WordPress Plugin Directory)
  • Install the plugin and activate it
  • Go to Settings > Post Webhook and enter the URL that you got from Airtable and click the Save Webhook URL button
  • Now you need to publish a post or update a post (you can simply go to an existing post and add and then delete a space, just so you can select the Update button but not actually change your post)

It is vital that you do the last step I mentioned, otherwise because you haven’t triggered the webhook, you won’t get any data into Airtable and you won’t be able to proceed with Step 4.

If you want to find out more about the plugin then you read more here Post Webhook Plugin – How to Use

Step 4 – Test your Airtable URL Receives Data from the Webhook

  • Go back to Airtable (within Automations) and click the Test trigger button
  • You should see a Step successful message and be able to see the data from the webhook
Airtable Test Webhook 3

That is technically it, you now have WordPress and Airtable successfully connected, well done. If you switched that automation on, every time you publish a post, update a post or delete a published post that data will come across to Airtable.

What we need to do now though is do something with that data. So we are going to store it in the table we created earlier. Now go and grab a coffee, take a short break or whatever because the next step is the longest part.

Step 5 – Capture Newly Published Post Data

  • Create a new action by selecting Add action > Find records
  • Select your table (in my case it’s called WordPress Posts)
  • Select Find records based on > Condition
  • Add a condition Where – Post GUID – contains – body post_guid
  • Click the Test action button and you should get a Step successful message
Airtable Find Records step
  • Now add a Conditional Action and click the If conditions are met link
  • Setup that condition to be If Records List of ‘Post GUID’ does not contain body post_guid
  • Then click the Test conditions button and make sure you get a successful message
  • Then select Add action > Create record and map the fields in your Airtable table to the corresponding fields from the webhook (as per the screenshot)
Airtable Create Records Field Mapping
  • Then click the Generate a preview button to make sure you get a Step successful message
  • Then select Run as configured > Run test and again you should get a Step successful message
  • If you now go back to your data view, you should see the data from that test in your table

That’s the automated process setup for newly published posts, well done on making it this far! trust me it will be worth it and you only have to set this up once.

Now we need to handle the process for updated posts which is more or less the same, so here we go.

Step 6 – Capture Updated or Trashed Post Data

  • Add a new Conditional Action and click the If conditions are met link
  • This time that condition should be If Records List of ‘Post GUID’ contains body post_guid
  • Then click the Test conditions button and make sure you get a successful message
  • Then select Add action > Update record and set the Record ID field to be ‘List of Airtable record ID’

I’m adding a screenshot here to show you how to set the Record ID field to ‘List of Airtable record ID’ as this is probably the most unintuitive step in the whole process:

Airtable Update Records Record ID
  • Still within the Update record action, again map the fields in your Airtable table to the corresponding fields from the webhook (as per the screenshot)
  • Then click the Generate a preview button to make sure you get a Step successful message
  • Then select Run as configured > Run test and again you should get a Step successful message
  • That’s it you are all done, phew. Now just set your Automation to be active and watch your data roll in every time you publish, update or delete an article

Leave a Comment