Best answer

Airtable/Wordpress Custom Post Types

  • 16 January 2024
  • 4 replies
  • 118 views

Userlevel 1

Hello,

tl;dr Is there a way to have Zapier read fields from custom post types in WordPress so I can map my airtable records to them?

I’m trying to create a solution for job postings for the HR dept of my company that automatically pushes Post Type: jobpost to WordPress via Create/Update posts for WordPress using a mostly automated airtable solution.

The functionality is HR user creates an airtable record, zapier creates a post that is of the type “jobpost” with specific parameters pre-defined in airtable and mapped in Zapier to a post.

However, Zapier reads the fields available to the base type of Post. but not of custom post type “jobpost”. And since I can’t map the airtable records to anything the zap fails because the mapping doesn’t exist.

I tried inspecting the source for fields and renaming fields to their WordPress source code div IDs. Job Title > post_title. Job description > post_content etc…

But this form of pseudo mapping didn’t work either.

Thank you.

icon

Best answer by Carlo_dev 16 January 2024, 23:29

View original

4 replies

Userlevel 7
Badge +14

Hi @Carlo_dev 

You may have to explore using the WordPress API via one of these actions.

 

Userlevel 1

I’m on it and i’ll report back. Thank you Troy.

Userlevel 1

edit: Credit to Troy for suggesting this approach.

I was able to make a successful API post to https://www.example-domain.com/wp-json/wp/v2/jobpost/ instead of the default/pre-configured https://www.example-domain.com/wp-json/wp/v2/posts/.

Then I rewrote the request to work within this post-type parameters and I was able to successfully post a jobpost via this endpoint.

I did specifically need to include:

"post_type": "{{post_type}}"

in the body of the request to get it to work even though I was hitting the jobpost endpoint specifically.

Currently don’t recommend using the Zapier AI request builder if you can avoid (I randomly sunk 30mins into it for no reason), just reference the WP REST-API docs and write your own request(s) and map your fields yourself.

Userlevel 7
Badge +6

That’s awesome @Carlo_dev! Thank you for sharing the solution here. This will be helpful to our other amazing Community members who might have a similar issue.

Happy Zapping!⚡️

Reply