# Integrating PHP-API-Request-Code within Wordpress (Elementor)

**URL:** <https://community.hubspot.com/t/integrating-php-api-request-code-within-wordpress-elementor/100759>\
**Category:** APIs & Integrations\
**Tags:** php\
**Created:** [February 22, 2024, 11:10am UTC](https://community.hubspot.com/t/integrating-php-api-request-code-within-wordpress-elementor/100759 "2024-02-22T11:10:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DWI](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DWI](https://community.hubspot.com/u/DWI)\
**Post date:** [February 22, 2024, 11:10am UTC](https://community.hubspot.com/t/integrating-php-api-request-code-within-wordpress-elementor/100759/1 "2024-02-22T11:10:29Z")

</div>

Hello everyone,

I am currently trying to integrate a PHP-API-Request (look screenshot) on a Wordpress site. My goal is to send the name and email to the HubSpot-Contact-Page, by taking the inputs from the user within a form. But because Wordpress does not accept raw \<?php ?\> code, I am struggling to integrate that request. This is why the PHP-Code currently within a \<script\>-tag and need a solution for that. Somehow it worked once like that, but not anymore and I don’t know why. I would appreciate any help, thank you!

 ![DWI_0-1708600162953.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/9/39add8d93f3f47459ca07429f0cdf74c7819739b.png)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 22, 2024, 8:54pm UTC](https://community.hubspot.com/t/integrating-php-api-request-code-within-wordpress-elementor/100759/2 "2024-02-22T20:54:36Z")

</div>

Hi, @DWI 👋 Thanks for your question. I’d like to invite some of our community members to the conversation — hey @tominal @danhammari @MatthiasWeber do you have any suggestions for @DWI?

Based on some quick research, it sounds like you’ll need to do this by creating a custom WordPress plugin or adding code to your theme’s functions.php file. And I am not a PHP user by any means.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![MatthiasWeber](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/matthiasweber/32/27498_2.png) [@MatthiasWeber](https://community.hubspot.com/u/MatthiasWeber)\
**Post date:** [February 23, 2024, 6:22am UTC](https://community.hubspot.com/t/integrating-php-api-request-code-within-wordpress-elementor/100759/3 "2024-02-23T06:22:26Z")

</div>

Hi @DWI. One idea from my side: use the wordpress plugin from hubspot. It’s pure magic when it comes to forms ;-). You can use forms created in hubspot or if you do your own form in wordpress / elementor / … the plugin catches the form submit and sends it hubspot. One pro tipp: if you use the hubspot field names in your form, it matches automaticly your data / content.

Or did you tried the plugin already?

Best

Matt
