# blockedDomains attribute doesn't work

**URL:** <https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [September 3, 2018, 9:44am UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642 "2018-09-03T09:44:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fred\_a](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fred_a/32/69256_2.png) [@fred\_a](https://community.hubspot.com/u/fred_a)\
**Post date:** [September 3, 2018, 9:44am UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/1 "2018-09-03T09:44:13Z")

</div>

Hi

I’m trying to block some domains. The form display well but doesn’t block anything… Could you please tell me what’s wrong with this code?

hbspt.forms.create({  
portalId: “xxxxxx”,  
formId: “xxxxxxxxxxxx”,  
css: “”,  
blockedDomains: [“[domain1.com](http://domain1.com)”, “[domain2.com](http://domain2.com)”],  
translations: {  
en: {  
required: “Please fill the required field.”,  
missingSelect: “Please select an option.”,  
forbiddenEmailDomain: “Please enter your business address”,  
manuallyBlockedEmailDomain: “Please enter your business address”,  
submitText: “WATCH NOW”  
}  
}  
});

Thanks

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [September 4, 2018, 8:25pm UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/2 "2018-09-04T20:25:16Z")

</div>

Hi [@fred\_a](https://community.hubspot.com/u/fred_a), looking at David’s response on [this thread](https://integrate.hubspot.com/t/how-to-block-domains-using-forms-api/2610), does removing the space between blocked domains help fix the issue?

---

<div class="post-metadata">

**Author:** ![fred\_a](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fred_a/32/69256_2.png) [@fred\_a](https://community.hubspot.com/u/fred_a)\
**Post date:** [September 5, 2018, 7:45am UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/3 "2018-09-05T07:45:10Z")

</div>

Thanks for your help [@Connor\_Barley](https://community.hubspot.com/u/connor_barley)! I tried [“[domain1.com](http://domain1.com)”,“[domain2.com](http://domain2.com)”] and “[domain1.com](http://domain1.com),[domain2.com](http://domain2.com)” (without spaces) but it still doesn’t work..

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [September 6, 2018, 8:59pm UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/4 "2018-09-06T20:59:49Z")

</div>

Hi [@fred\_a](https://community.hubspot.com/u/fred_a),

I tested this a bunch in my own portal and it wasn’t working at first. I then slowly deleted and re-added elements of your code. This code you sent over, and the code I used here in my portal seemed to work, but then it stopped working again. I’m going to have to keep digging into this one and update you when I have a solid answer.

---

<div class="post-metadata">

**Author:** ![fred\_a](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fred_a/32/69256_2.png) [@fred\_a](https://community.hubspot.com/u/fred_a)\
**Post date:** [September 7, 2018, 6:59am UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/5 "2018-09-07T06:59:13Z")

</div>

ok, strange… Thanks [@Connor\_Barley](https://community.hubspot.com/u/connor_barley)!

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [September 24, 2018, 12:54pm UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/6 "2018-09-24T12:54:34Z")

</div>

Hi [@fred\_a](https://community.hubspot.com/u/fred_a), Engineering has pushed out a fix for this issue. Can you check to see if you’re able to use that parameter now?

---

<div class="post-metadata">

**Author:** ![fred\_a](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fred_a/32/69256_2.png) [@fred\_a](https://community.hubspot.com/u/fred_a)\
**Post date:** [September 25, 2018, 3:34pm UTC](https://community.hubspot.com/t/blockeddomains-attribute-doesnt-work/11642/7 "2018-09-25T15:34:58Z")

</div>

Thanks [@Connor\_Barley](https://community.hubspot.com/u/connor_barley) I replied in this topic: [Blocked domains in form embed](https://integrate.hubspot.com/t/blocked-domains-in-form-embed/5042/8)
