How to Stop HubSpot From Creating Duplicate Forms Automatically?

I’m using the HubSpot forms API to send contact form data to my account. The submissions work fine, but there’s an annoying problem. Every time someone submits the form, HubSpot creates a new duplicate form automatically in the Marketing section. These auto-created forms have random names like #form_abc123def and are labeled as “non-HubSpot forms”. The system explanation says these are HTML forms not created in HubSpot that get tracked automatically. The weird thing is that the data appears in both my original form AND these new auto-generated ones. Here’s my current implementation:

// config.php
define('HS_ACCOUNT_ID', getenv('hubspot_account_id'));
define('HS_FORM_ID', getenv('hubspot_form_id'));
define('HS_API_URL', "https://forms.hubspot.com/uploads/form/v2/".HS_ACCOUNT_ID."/".HS_FORM_ID);

// submission.php
function send_to_hubspot($current_url, $title, $api_endpoint, $form_data) {
    $context_data = array(
        'ipAddress' => $_SERVER['REMOTE_ADDR'],
        'pageUrl' => $current_url,
        'pageName' => $title,
    );
    
    if (isset($_COOKIE['hubspotutk'])) {
        $context_data['hutk'] = $_COOKIE['hubspotutk'];
    }
    
    $form_data['hs_context'] = $context_data;
    
    $post_string = "";
    foreach ($form_data as $field => $val) {
        if (is_string($val)) {
            $val = urlencode($val);
        } else if (is_array($val)) {
            $val = json_encode($val);
        }
        $post_string .= $field . "=" . $val . "&";
    }
    
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $api_endpoint);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, rtrim($post_string, "&"));
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($curl);
    curl_close($curl);
    return $response;
}

// usage
$submission_result = send_to_hubspot(
    "https://mysite.com/contact-us/",
    "Contact Us Page",
    HS_API_URL,
    array(
        "firstname" => $_POST["first_name"],
        "lastname" => $_POST["last_name"],
        "email" => $_POST["email_address"],
        "phone" => $_POST["phone_number"],
        "message" => $_POST["user_message"],
    )
);

Is there a way to prevent these duplicate forms from being created? My forms dashboard is getting cluttered with dozens of these auto-generated entries that I have to manually delete. My original form is organized in a folder while these duplicates appear at the root level.

Been dealing with HubSpot’s quirky behavior for years. Those duplicate forms happen because HubSpot’s tracking script detects form submissions and auto-creates “non-HubSpot forms” even when you’re using their API.

You’re basically stuck managing two systems - your form logic and HubSpot’s automatic tracking. Even tweaking skipValidation won’t stop you from fighting HubSpot’s built-in behavior.

I fixed this by moving everything to Latenode. Instead of wrestling with HubSpot’s API quirks, I built a simple automation that:

  • Gets form data from my site
  • Processes it how I want
  • Sends clean data to HubSpot without triggering auto-form creation
  • Keeps everything organized

No more random #form_abc123def entries cluttering my dashboard. The automation handles data flow cleanly without HubSpot’s tracking script messing things up.

10 minutes to set up, saves me hours of cleanup every week. Way better than working around HubSpot’s automatic detection.

Same thing happened to me! HubSpot tracks form submissions even through their API. Add “skipValidation”: true and “submittedAt”: timestamp to your hs_context array - cut down duplicates for me. Also check if your tracking code’s causing issues.

I had this exact problem. It’s HubSpot’s tracking code on your site causing it. Even when you submit via API, the tracking script still detects form submissions and auto-creates those phantom forms. Just add data-hs-ignore="true" to your form element. This tells HubSpot to ignore that specific form but keeps your API submissions working fine. html <form data-hs-ignore="true" method="post" action="..."> Your API stays intact, no more duplicate entries. I’ve been using this for months - zero auto-generated forms in my dashboard.

I had this exact problem two years ago when connecting multiple client sites to HubSpot. The issue is your hs_context configuration - you’re missing the form identifier that tells HubSpot which existing form this submission belongs to. Add these two parameters to your context_data array: $context_data = array(‘ipAddress’ => $_SERVER[‘REMOTE_ADDR’], ‘pageUrl’ => $current_url, ‘pageName’ => $title, ‘pageId’ => HS_FORM_ID, ‘contentType’ => ‘standard-page’); The pageId parameter is key - it links the submission to your existing form. Without it, HubSpot thinks every API submission comes from an unknown external form and creates those duplicate entries. Fixed the clutter issue completely across all my sites.