Google Sheets to WordPress Custom Post Types with REST API

Sdílet
Vložit
  • čas přidán 21. 07. 2024
  • Last time we made an API to show Google Sheet records in our #Wordpress website using #JetEngine REST API but today we will directly insert our sheet data as CPT or CCT in Wordpress.
    Google Apps Script:
    softemblems.com/google-sheets...
    Topics:
    00:00:00 Introduction & Demo
    00:01:35 Creating Custom Post Types
    00:02:25 Insert CPT using Postman
    00:04:33 REST API Authorization
    00:05:50 Google App Script Code
    00:09:00 Setup Trigger
    Download #Elementor:
    elementor.com/?ref=16401
    Download #Crocoblock:
    crocoblock.com/?ref=4088
    Need to build dynamic websites?
    softemblems.com
    Track: Peruvian Woods - Dave Osorio [Audio Library Release]
    Music provided by Audio Library Plus
    Watch: • Peruvian Woods - Dave Osorio | Free B...
    Free Download / Stream: alplus.io/peruvian-woods
  • Věda a technologie

Komentáře • 133

  • @mihaiciobanu01
    @mihaiciobanu01 Před 7 měsíci +6

    This is awesome, please do more of these tutorials on JetEngine, i think you are one of the best devs on this topic. Cheers!

  • @harzadventure
    @harzadventure Před 7 měsíci +2

    Great tutorial, as always. You show the real power of JetEngine, thank you so much and keep going. :)

  • @christiane-peschen
    @christiane-peschen Před 7 měsíci

    This is a great tutorial, would be great to see more posts like this in the future

  • @digwillhachi
    @digwillhachi Před 7 měsíci

    your tutorials are great, so useful and nothing else like them.

  • @AidanJoyce
    @AidanJoyce Před 6 měsíci

    Excellent video and instruction - Thank you for sharing.

  • @darthjarjarthewise8051
    @darthjarjarthewise8051 Před 6 měsíci +1

    Nice video as always! It would be nice if you could do a video how to optimize a WordPress website, especially a website with crocoblock plugins

  • @fatjay9402
    @fatjay9402 Před 7 měsíci

    Perfect ! .. i will test this

  • @mochannel2482
    @mochannel2482 Před 6 měsíci

    This is awesome, thank you

  • @JodKapilakan
    @JodKapilakan Před 7 měsíci

    Thank you for the useful tutorial. A featured image tutorial would be nice

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      You can check these documentation for image
      stackoverflow.com/questions/63830915/read-images-from-system-or-url-using-google-apps-script-in-google-sheets-and-pos

  • @visualmodo
    @visualmodo Před 6 měsíci +1

    Very good content :)

  • @dbx339
    @dbx339 Před 7 měsíci

    awesome sir. keep it up

  • @casildahursan4985
    @casildahursan4985 Před 3 měsíci

    Thank you very much, very useful! With the setup you show in the video, If you update or create a post (Lead) from WP will it be shown in GSheets? Thanx again

  • @alfred1411
    @alfred1411 Před 3 měsíci

    Great tutorial!
    I have a question. How I can add terms to the post from this sheet to WP? Thanks in advance for your answer.

  • @abdulhamid.469
    @abdulhamid.469 Před 7 měsíci

    @Moxet Khan Great to learn something new.

  • @sergioolivares
    @sergioolivares Před 6 měsíci +2

    Hello! How can I pass data as select field, or checkbox field instead of text field on JetEngine post types?

  • @juliangomezacevedo4657
    @juliangomezacevedo4657 Před 2 měsíci

    I love your tutorials, do you think is possible to do it with cct? maybe some advise on how to do it? thanks!

    • @MoxetKhanPK
      @MoxetKhanPK  Před 2 měsíci

      Thank you, it has same concept, CCT also provides endpoints.

  • @user-kd6gg9op8q
    @user-kd6gg9op8q Před 7 měsíci

    Thank you, brother Moxet Khan, for your excellent tutorials.
    I have a question for you:
    Is it possible to replace the date field used in JetFormBuilder with the bootstrap-datepicker or any other service so that it appears uniformly across all browsers?
    Thank you for your fantastic efforts!

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      Yes possible but you need to contact crocoblock support to give you the right direction. Worst case scenario you can use jquery.

  • @PauloSilvadg
    @PauloSilvadg Před 3 měsíci

    Excelente tutorial, me sirvió mucho. Sería genial un plugin que haga esa conexión. Pero como crear el postman mi propio? no entendi la integración con wordpress

  • @CarlosMagnoSBomfim
    @CarlosMagnoSBomfim Před 4 měsíci

    Do I need to perform any other configuration to generate the ID via macro? Or add some other permission... Everything worked perfectly in Postman

    • @MoxetKhanPK
      @MoxetKhanPK  Před 4 měsíci

      Make sure your code run onChange event so the time you type and leave the cell it will trigger the API and insert ID

  • @guruttomanila
    @guruttomanila Před 5 měsíci

    Good Day Master Moxet, is it possible to use jetform builder vice versa? if you edit the fields via form , is there a possible way to sycnhronize post types and googlesheet? this googlesheet method is one of the best way to import or update post types, but what if i want to update post type via form, and it will also update the googlesheet data, if you have tutorials can you share it with us?

  • @AMIRHANOFF
    @AMIRHANOFF Před 2 měsíci +1

    How to add meta repeater field data so that it works without errors? I tried many options but it doesn't help

  • @kevinwedin4293
    @kevinwedin4293 Před 6 měsíci

    Thank you! Would you mind showing how to use other meta fields than textfield - say for example checkbox?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      Well for each type we need to pass data accordingly, for example checkbox accept direct value, switcher should be true or false and date should be date format and so one. Please try sending meta["checkbox_meta"]="pre-set-check-box-value"

    • @kevinwedin4293
      @kevinwedin4293 Před 6 měsíci

      Will try! Thanks! And...do you know a way to change the slug of the page with a column that is not Post Title? @@MoxetKhanPK

    • @kevinwedin4293
      @kevinwedin4293 Před 6 měsíci

      Basicly - when the post title is the same for many posts I dont want it to be /marketingoffer2, /marketingoffer2 etc. So a way to easily customize it. Hope you understand what I mean :)

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci

      @@kevinwedin4293 Yes you can have unique slugs as per the documentation here. developer.wordpress.org/rest-api/reference/posts/#schema-slug

    • @kevinwedin4293
      @kevinwedin4293 Před 6 měsíci

      So good thanks! Another question: I have created two CPT - "Education programs" and "Cities". So I have like 800 programs and 150 cities. Is there a way on the CPT for cities, when I create the single post template, to in the listing grid connect each "cities" that I have as a texonomy on the "educations" CPT? I know I could yous the cities taxonomy as a page - but I dont think its optimal in SEO-terms. @@MoxetKhanPK

  • @KaifShaikhTaufiq
    @KaifShaikhTaufiq Před 3 měsíci

    I wanted to learn about hooks , how to create php functions like you did for enail code validation to update check , crocoblock the best way
    What source you would recommend me
    i know elementor , figma designs
    I am learning dyanmic features for wordpress using crocoblock

  • @popopp2297
    @popopp2297 Před 7 měsíci

    This is amazing! In App Script, what type of deployment do I need to select? There is 4 options: Web App, API Executable, Add-on and Library. Thank you for your training video.

    • @popopp2297
      @popopp2297 Před 7 měsíci

      I figured out my question. A great addition to this video would be field mapping and how to build out your page or post with this data from a UI perspective.

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      @@popopp2297 That is the most simplest thing, once you transfer CPT from Google to Worpdress the rest of the methodology is similar, there are dozens of tutorial covers how to design the UI.

  • @sabyasachide9190
    @sabyasachide9190 Před 6 měsíci

    Can we connect over email? Have some custom project.

  • @anthonyespino7214
    @anthonyespino7214 Před 6 měsíci

    Hi friend. Greetings from Peru. You are big. I have a question. Can you relate to an author (user) from Google Sheets?, since said post has to be related to an author (user).

  • @AnthonyTilahun
    @AnthonyTilahun Před 3 měsíci

    What about other tabs inside of google sheet? How does that work? If I want to create a food menu and want to use cct and create another field with Food type or Drink type, and that field is a drop down selection, how would that work?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 3 měsíci +1

      As explained in 6:10 you can choose your sheet. You need to customize the code to meet your requirements.

  • @stefaniacharitou
    @stefaniacharitou Před 7 měsíci

    Could this or something similar work with ACF fields in a CPT? I'm trying to create a verb conjugator, so verbs are my custom posts, and each post's content is full of ACF fields for all the different verb forms (I am, you are, he is, etc.).

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci

      It must work, i never used ACF with this sort of integration but the flow/mechanism is more or less same. They also use REST API.

  • @user-te1oi7pg6x
    @user-te1oi7pg6x Před měsícem

    Hello Sir! Do we need to add 'post_' before each meta variable?

  • @user-oc7my8gl8z
    @user-oc7my8gl8z Před 7 měsíci

    Again Great Tutorial!! Question: Can we achieve this also with cct?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      Same method, you need to change the endpoint url to your cct url.

    • @AnthonyTilahun
      @AnthonyTilahun Před měsícem

      @@MoxetKhanPK This is not the same method, I've tried this several times with cct and the CCT value names are not the same, For Ex. You're not working with Post IDs, but rather _ID (ITEM ID), alot changes, a simple url swap for the endpoint doesn't work

    • @MoxetKhanPK
      @MoxetKhanPK  Před měsícem

      @@AnthonyTilahun You need to learn the logic, offcourse it can't be 100% same if the instances are not same.

  • @FuriosMind
    @FuriosMind Před 3 měsíci

    Hi, this works both ways? If I edit the post on wordpress he will update on gogle sheets?

  • @fatjay9402
    @fatjay9402 Před 4 měsíci

    @Moset Khan is it possible to load in allready made Wordpress post and Edit it with googlesheet so you can do it faster ?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 4 měsíci

      i don't see any benifits of importing wordpress to sheet, edit and publish it again unless it is a tabuler data.
      Yes it is possible..

    • @fatjay9402
      @fatjay9402 Před 4 měsíci

      @@MoxetKhanPK Because for example i have a 2000 Posts that i need to update fields and ( put in info for the new felds ) and doing that manual takes around 5 - 10 mins per Post right now.. i was hoping to do it faster in google sheets and using maybe ChatGPT or something .. That why i am asking

  • @codemilestone7697
    @codemilestone7697 Před 6 měsíci

    Please send full videos how to enbale also restAPI

  • @arielsegovia2313
    @arielsegovia2313 Před měsícem

    Hello, I generated a formula to add 20% to a value but since it is not typed and it is a calculation, it does not take the update, that is, the value is never sent to the CPT, I tried typing a value in that box and there it is Send correctly, any idea what it could be?

    • @MoxetKhanPK
      @MoxetKhanPK  Před měsícem

      You need to change the trigger from change to save i guess.

  • @CarlosMagnoSBomfim
    @CarlosMagnoSBomfim Před 4 měsíci

    Did anyone get it and could help me?
    I tried every possible way, in Postman it works perfectly, but when I switch to Google Sheet it doesn't work. Problem with the spreadsheet, it doesn't generate the Id or the Status, I've tried to configure it in different ways but I can't, I've been trying for a week and nothing, could anyone help me?

  • @ssaikat200
    @ssaikat200 Před měsícem

    how to set the thumbnail image?

  • @shahinulislam9304
    @shahinulislam9304 Před 7 měsíci +1

    Claiming to make a complete tutorial from scratch.

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      complete tutorial for?

    • @shahinulislam9304
      @shahinulislam9304 Před 7 měsíci

      @@MoxetKhanPK WordPress post will upload into Google Sheets same as this, please

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      @@shahinulislam9304 i already made it here czcams.com/video/6MeA0qdhlmI/video.html

  • @guruttomanila
    @guruttomanila Před 4 měsíci

    Do You have codes for CCT? tried using the code in CCT but cant able to run it, i change post_title to my CCT Title like sample_title

    • @MoxetKhanPK
      @MoxetKhanPK  Před 4 měsíci +1

      There is one shared by Haxrat Bilal in Facebook group do check.

    • @guruttomanila
      @guruttomanila Před 4 měsíci

      can you send us a link for this group?@@MoxetKhanPK

  • @kevinwedin4293
    @kevinwedin4293 Před 4 měsíci

    I've made Meta Field for "date" in my CPT. But when typing the date in the Google Sheets, it does not happen anything with the Meta Field inside the post. Is there a specific way to write the date in Google Sheets to make it get in as a date? Thanks in advance.

    • @MoxetKhanPK
      @MoxetKhanPK  Před 4 měsíci

      Parse date in code before sending it to wordpress in proper format. Most probabaly push it as string

    • @kevinwedin4293
      @kevinwedin4293 Před 4 měsíci

      Hmm. What would that be for say 08/03/2024 (March 8 2024)?@@MoxetKhanPK

    • @kevinwedin4293
      @kevinwedin4293 Před 3 měsíci

      @@MoxetKhanPK Hmm...Nothing happens when I push "2024-03-16" in Google sheets. Can't send picture here to show, do you have any reccomendation?

  • @chunaksharora7463
    @chunaksharora7463 Před 5 měsíci

    when im updating phone its says error 400. but when im inserting text in phone its updating but not updating with just numbers. why?

    • @chunaksharora7463
      @chunaksharora7463 Před 5 měsíci

      got it the data type in google sheet for the number was numeric it should be plain text

  • @SamWereb
    @SamWereb Před 7 měsíci +1

    02:53 and 06:12 Where do i find my endpoint URL? Is it the same as yours, but with my root domain name url?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci +2

      Exactly! just change my website URL to yours and the CPT slug with yours, i am using leads as cpt you might have posts or something else.

    • @SamWereb
      @SamWereb Před 7 měsíci

      @@MoxetKhanPK Thank you!

    • @codemilestone7697
      @codemilestone7697 Před 6 měsíci

      ​@@MoxetKhanPK how I enable RestAPI and postman??

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      @@codemilestone7697 explained in first part of video

    • @codemilestone7697
      @codemilestone7697 Před 6 měsíci

      @@MoxetKhanPK can you please send me the first part video link please?

  • @uminurlis
    @uminurlis Před 5 měsíci

    what if we want to add an image, and what code do we add in the app script. can you show and write the code please

    • @MoxetKhanPK
      @MoxetKhanPK  Před 5 měsíci

      chatgpt and google is your friend, do a bit research and use base64 encoded image.

    • @uminurlis
      @uminurlis Před 5 měsíci

      @@MoxetKhanPK i don't have coding skill, i'm stil new in this, can you help me

    • @MoxetKhanPK
      @MoxetKhanPK  Před 5 měsíci

      @@uminurlis you can send message on my fiverr to discuss in details

  • @user-xb5zm6vy6n
    @user-xb5zm6vy6n Před 7 měsíci

    Can you do a video of dynamic function for jet engine thanks

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      What exactly you need in dynamic function?

    • @user-xb5zm6vy6n
      @user-xb5zm6vy6n Před 7 měsíci

      @@MoxetKhanPK I would like add a calculation function with meta fields or rest API fields values

  • @matthieudondey8844
    @matthieudondey8844 Před 3 dny

    I'm tring to pass meta field information as numbers but I keep getting an error Failed: 307 or an error Failed: 400 whenever I try to add in data for the meta fields. Why would that be? Could someone help? Is the process different if the meta field is not a "Text" but a "Number" ?

    • @matthieudondey8844
      @matthieudondey8844 Před 3 dny +1

      Ok after maaaaany hours of trying to pass a number to a meta field of type "Number", I found the solution! (I kept having a Failed: 307 error)
      var post_numberMeta = sheet.getRange(affectedRow, 4).getValue().toString(); // Ensure post_numberMeta is a string
      Key is to add the ".toString()" function. In the CPT, it is still interpreted as a number.

  • @MDABUSHAYDMOUDUDI
    @MDABUSHAYDMOUDUDI Před 6 měsíci

    Sir please making a video about create chatting function with jet engine.

  • @PROSIMSI
    @PROSIMSI Před 7 měsíci +1

    hi, its postible insert to CCT?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci

      Same method, you need to change the endpoint url to your cct url.

    • @PROSIMSI
      @PROSIMSI Před 7 měsíci

      thanks, its amazing and save my time anf all my clients time

    • @PROSIMSI
      @PROSIMSI Před 6 měsíci

      @@MoxetKhanPK i have next question :) how delete cpt in WP if i delete row in google sheet?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      @@PROSIMSI custom code

  • @DavidMurrin77
    @DavidMurrin77 Před 7 měsíci

    Can you also delete a post this way?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 7 měsíci +1

      Yes you can, you can follow this guideline
      wordpress.stackexchange.com/questions/400993/delete-request-using-wp-rest-api

  • @devonjordaan5181
    @devonjordaan5181 Před 4 měsíci

    Hi, I followed the whole setup but for some reason its not working? How does the sheets connect to wordpress?

    • @MoxetKhanPK
      @MoxetKhanPK  Před 4 měsíci

      It connects with REST API

    • @devonjordaan5181
      @devonjordaan5181 Před 4 měsíci

      Hi, when I did all the things you did above its not connecting to the website. When I add something on the sheets the status shows "Failed: 404"
      I even created the same cpt as you and same metafields with same ID and everything. Do you maybe know why its doing that? @@MoxetKhanPK

    • @devonjordaan5181
      @devonjordaan5181 Před 4 měsíci

      Hi, when I start adding items in sheets the table says Failed: 400 of Failed: 404. I added the exact same cpt as you with the same metafields and still its not working. When I use Postman it creates the posts but when i add to sheets after everything its not working? @@MoxetKhanPK

    • @devonjordaan5181
      @devonjordaan5181 Před 4 měsíci

      Hi, I finally got it! It was my Jetengine fields that was corrupt for some reason. I now have another question, I am pushing data from zoho flow to sheets. So now sheets is not seeing the trigger "on edit" so its not publishing the posts... How can I somehow make the trigger run when flow pushes the data? @@MoxetKhanPK

    • @devonjordaan5181
      @devonjordaan5181 Před 4 měsíci

      Moxet helped with this, thanks so much. Quick and reliable :)

  • @fatjay9402
    @fatjay9402 Před 5 měsíci

    Sorry this is not clear... do i need postmade to use Google sheet , ?? Pls make better steps for what is whats ir feels like have of Infos are missing 😢 😢😢

  • @codemilestone7697
    @codemilestone7697 Před 6 měsíci

    On How to connect with taxonomy like city ??

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      Send city ID from your sheet

    • @codemilestone7697
      @codemilestone7697 Před 6 měsíci

      @@MoxetKhanPK I already did with taxonomy id using Array but It's not working dynamically please can you help me?

    • @codemilestone7697
      @codemilestone7697 Před 6 měsíci

      @@MoxetKhanPK if you want can I share you my code??

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci +1

      @@codemilestone7697 why array? You should pass integer value of term ID just like i did in this tutorial

    • @codemilestone7697
      @codemilestone7697 Před 6 měsíci

      @@MoxetKhanPK its not working I did lots time on google sheet Apps script then I going to help Chat GPT and try to work like 3 days still not solve this issue can you please help me this one time my humble request please

  • @codemilestone7697
    @codemilestone7697 Před 7 měsíci

    boss Brother Just boss

  • @AlejandroLopez-dz4xn
    @AlejandroLopez-dz4xn Před měsícem

    Thank you for your tutorial, but i believe your are missing an important thing, lets say you need to load a big chunk of data, how would you do it? as far as i understand, here you explain how to do it one by one, but when you have loads and loads of rows, this example its not really a good idea, is it?

    • @MoxetKhanPK
      @MoxetKhanPK  Před měsícem

      I know that, two solutions- the trigger should be changed to save and the code must be alter as well. Alternatively use free plugin if data is a lot.

  • @AnthonyTilahun
    @AnthonyTilahun Před měsícem

    Why don't you link to postman?

    • @MoxetKhanPK
      @MoxetKhanPK  Před měsícem

      Why should i do?

    • @AnthonyTilahun
      @AnthonyTilahun Před měsícem

      @@MoxetKhanPK Not to your post man link but just to the url itself, it would be helpful to those that are just beginning.

    • @MoxetKhanPK
      @MoxetKhanPK  Před měsícem

      @@AnthonyTilahun the video is not about postman

  • @unggulkirindi6556
    @unggulkirindi6556 Před 6 měsíci +1

    It seems like a step in this tutorial is missing.

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci

      Which is?

    • @unggulkirindi6556
      @unggulkirindi6556 Před 6 měsíci

      @@MoxetKhanPK In the status column, Failed 404 / 403 appears. The ID in the Post ID field does not appear automatically. I've followed everything.

    • @MoxetKhanPK
      @MoxetKhanPK  Před 6 měsíci

      @@unggulkirindi6556 403 mean you dont have enough permission or your REST API has error.

    • @CarlosMagnoSBomfim
      @CarlosMagnoSBomfim Před 4 měsíci

      Mine, after managing to activate the code and stop giving errors, I have the same problem, it doesn't generate the automatic ID and apparently it prevents the information from being passed to Wordpress.
      I already added Rest API authorizations anyway, but unfortunately it won't work.

  • @ib4112
    @ib4112 Před 7 měsíci

    PErfect

  • @KaifShaikhTaufiq
    @KaifShaikhTaufiq Před 3 měsíci

    Hello there, why don’t you create a discord server and people with like minded can help each other

  • @CarlosMagnoSBomfim
    @CarlosMagnoSBomfim Před 4 měsíci

    Did anyone get it and could help me?
    I tried every possible way, in Postman it works perfectly, but when I switch to Google Sheet it doesn't work. Problem with the spreadsheet, it doesn't generate the Id or the Status, I've tried to configure it in different ways but I can't, I've been trying for a week and nothing, could anyone help me?

    • @AsadRafique-zw3ey
      @AsadRafique-zw3ey Před 3 měsíci

      Same Question From my side as well how Post ID and Status generated automatically ?